Skip to content

Commit 4afbeef

Browse files
committed
add workflow to compare config
1 parent 09a0aa9 commit 4afbeef

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

.github/workflows/compare.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Compare Kernel Config
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
branches:
7+
- 'master'
8+
9+
jobs:
10+
genconfig:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- arch: x86_64
16+
karch: x86
17+
- arch: aarch64
18+
karch: arm64
19+
- arch: riscv64
20+
karch: riscv
21+
- arch: loongarch64
22+
karch: loongarch
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
path: repo
28+
- uses: actions/checkout@v4
29+
with:
30+
ref: master
31+
path: repo-old
32+
- uses: actions/checkout@v4
33+
with:
34+
repository: eweOS/packages
35+
ref: linux
36+
path: pkg
37+
- run: >-
38+
docker run
39+
--rm
40+
-v $(pwd):/${{ github.workspace }}
41+
-w ${{ github.workspace }}
42+
ghcr.io/eweos/docker:buildenv
43+
bash -c "
44+
pushd pkg &&
45+
pacman -Syu --noconfirm && makepkg -os --noconfirm &&
46+
kdir=pkg/src/\$(source PKGBUILD && echo \$_basename-\$pkgver) &&
47+
popd &&
48+
repo/scripts/generate-config.sh ${{ matrix.arch }} ${{ matrix.karch }} \$kdir &&
49+
cp \$kdir/.config config-new &&
50+
repo-old/scripts/generate-config.sh ${{ matrix.arch }} ${{ matrix.karch }} \$kdir &&
51+
cp \$kdir/.config config-old &&
52+
diff -urN config-old config-new > config.diff || true
53+
"
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: diff-${{ matrix.arch }}
57+
path: config.diff
58+
59+
compare:
60+
runs-on: ubuntu-latest
61+
needs: [genconfig]
62+
steps:
63+
- uses: peter-evans/find-comment@v3
64+
id: fc
65+
with:
66+
issue-number: ${{ github.event.pull_request.number }}
67+
comment-author: 'github-actions[bot]'
68+
body-includes: '## Config Compare'
69+
- uses: actions/download-artifact@v4
70+
with:
71+
name: diff-x86_64
72+
path: diff-x86_64
73+
- uses: actions/download-artifact@v4
74+
with:
75+
name: diff-aarch64
76+
path: diff-aarch64
77+
- uses: actions/download-artifact@v4
78+
with:
79+
name: diff-riscv64
80+
path: diff-riscv64
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: diff-loongarch64
84+
path: diff-loongarch64
85+
- run: >-
86+
echo "## Config Compare" >> diff.output &&
87+
for outarch in x86_64 aarch64 riscv64 loongarch64; do
88+
(echo "## $outarch" >> diff.output &&
89+
echo '```diff' >> diff.output &&
90+
echo "diff for $outarch" >> diff.output &&
91+
cat diff-$outarch/config.diff >> diff.output &&
92+
echo '```' >> diff.output);
93+
done
94+
- uses: peter-evans/create-or-update-comment@v4
95+
with:
96+
comment-id: ${{ steps.fc.outputs.comment-id }}
97+
issue-number: ${{ github.event.pull_request.number }}
98+
body-path: diff.output
99+
edit-mode: replace

0 commit comments

Comments
 (0)