Skip to content

Commit 43f74bb

Browse files
committed
hack: complete CI workflow redesign
Work in progress! Signed-off-by: Richard Alpe <richard@bit42.se>
1 parent 6d53d92 commit 43f74bb

File tree

4 files changed

+138
-115
lines changed

4 files changed

+138
-115
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: Bob the Builder
1+
name: Build Infix
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened, labeled]
6-
push:
7-
branches:
8-
- main
94
workflow_dispatch:
105
inputs:
116
minimal:
@@ -18,13 +13,18 @@ on:
1813
required: false
1914
default: true
2015
type: boolean
16+
17+
workflow_call:
18+
#TODO: Rename
19+
matrix:
20+
target:
21+
required: true
22+
type: string
2123
jobs:
2224
build:
2325
name: Build Infix ${{ matrix.target }}
2426
runs-on: [ self-hosted, latest ]
2527
strategy:
26-
matrix:
27-
target: [aarch64, x86_64]
2828
fail-fast: false
2929
outputs:
3030
build_id: ${{ steps.vars.outputs.INFIX_BUILD_ID }}
@@ -150,110 +150,3 @@ jobs:
150150
with:
151151
path: output/${{ steps.vars.outputs.tgz }}
152152
name: artifact-${{ matrix.target }}
153-
154-
test:
155-
name: Regression Test of Infix x86_64
156-
needs: build
157-
runs-on: [ self-hosted, regression ]
158-
steps:
159-
- uses: actions/checkout@v4
160-
with:
161-
clean: true
162-
submodules: recursive
163-
164-
- name: Set Build Variables
165-
id: vars
166-
run: |
167-
if [ -n "${{ needs.build.outputs.build_id }}" ]; then
168-
echo "INFIX_BUILD_ID=${{ needs.build.outputs.build_id }}" \
169-
>>$GITHUB_ENV
170-
fi
171-
172-
if [ "$GITHUB_REF_NAME" != "main" ]; then
173-
flavor="_minimal"
174-
else
175-
flavor=""
176-
fi
177-
echo "flv=$flavor" >> $GITHUB_OUTPUT
178-
179-
- name: Configure x86_64${{ steps.vars.outputs.flv }}
180-
run: |
181-
make x86_64${{ steps.vars.outputs.flv }}_defconfig
182-
183-
- uses: actions/download-artifact@v4
184-
with:
185-
pattern: "artifact-*"
186-
merge-multiple: true
187-
188-
- name: Restore x86-64${{ steps.vars.outputs.flv }} output/
189-
run: |
190-
ls -l
191-
mkdir -p output
192-
mv infix-x86_64.tar.gz output/
193-
cd output/
194-
tar xf infix-x86_64.tar.gz
195-
ln -s infix-x86_64 images
196-
197-
- name: Regression Test x86_64${{ steps.vars.outputs.flv }}
198-
run: |
199-
make test
200-
201-
- name: Publish Test Result for x86_64${{ steps.vars.outputs.flv }}
202-
# Ensure this runs even if Regression Test fails
203-
if: always()
204-
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
205-
206-
- name: Generate Test Report for x86_64${{ steps.vars.outputs.flv }}
207-
# Ensure this runs even if Regression Test fails
208-
if: always()
209-
run: |
210-
asciidoctor-pdf \
211-
--theme test/9pm/report/theme.yml \
212-
-a pdf-fontsdir=test/9pm/report/fonts \
213-
test/.log/last/report.adoc \
214-
-o test/.log/last/report.pdf
215-
216-
- name: Upload Test Report as Artifact
217-
uses: actions/upload-artifact@v4
218-
with:
219-
name: test-report
220-
path: test/.log/last/report.pdf
221-
222-
release:
223-
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
224-
name: Upload Latest Build
225-
needs: test
226-
runs-on: ubuntu-latest
227-
permissions:
228-
contents: write
229-
steps:
230-
- uses: actions/download-artifact@v4
231-
with:
232-
pattern: "artifact-*"
233-
merge-multiple: true
234-
235-
- name: Create checksums ...
236-
run: |
237-
for file in *.tar.gz; do
238-
sha256sum $file > $file.sha256
239-
done
240-
241-
- uses: ncipollo/release-action@v1
242-
with:
243-
allowUpdates: true
244-
omitName: true
245-
omitBody: true
246-
omitBodyDuringUpdate: true
247-
prerelease: true
248-
tag: "latest"
249-
token: ${{ secrets.GITHUB_TOKEN }}
250-
artifacts: "*.tar.gz*"
251-
252-
- name: Summary
253-
run: |
254-
cat <<EOF >> $GITHUB_STEP_SUMMARY
255-
# Latest Build Complete! :rocket:
256-
257-
For the public download links of these build artifacts, please see:
258-
<https://github.com/kernelkit/infix/releases/tag/latest>
259-
EOF

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish latest Infix
2+
3+
jobs:
4+
publish:
5+
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
6+
name: Upload Latest Build
7+
needs: test
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/download-artifact@v4
13+
with:
14+
pattern: "artifact-*"
15+
merge-multiple: true
16+
17+
- name: Create checksums ...
18+
run: |
19+
for file in *.tar.gz; do
20+
sha256sum $file > $file.sha256
21+
done
22+
23+
- uses: ncipollo/release-action@v1
24+
with:
25+
allowUpdates: true
26+
omitName: true
27+
omitBody: true
28+
omitBodyDuringUpdate: true
29+
prerelease: true
30+
tag: "latest"
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
artifacts: "*.tar.gz*"
33+
34+
- name: Summary
35+
run: |
36+
cat <<EOF >> $GITHUB_STEP_SUMMARY
37+
# Latest Build Complete! :rocket:
38+
39+
For the public download links of these build artifacts, please see:
40+
<https://github.com/kernelkit/infix/releases/tag/latest>
41+
EOF

.github/workflows/test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test Infix
2+
jobs:
3+
test:
4+
name: Regression Test of Infix x86_64
5+
needs: build
6+
runs-on: [ self-hosted, regression ]
7+
steps:
8+
- uses: actions/checkout@v4
9+
with:
10+
clean: true
11+
submodules: recursive
12+
13+
- name: Set Build Variables
14+
id: vars
15+
run: |
16+
if [ -n "${{ needs.build.outputs.build_id }}" ]; then
17+
echo "INFIX_BUILD_ID=${{ needs.build.outputs.build_id }}" \
18+
>>$GITHUB_ENV
19+
fi
20+
21+
if [ "$GITHUB_REF_NAME" != "main" ]; then
22+
flavor="_minimal"
23+
else
24+
flavor=""
25+
fi
26+
echo "flv=$flavor" >> $GITHUB_OUTPUT
27+
28+
- name: Configure x86_64${{ steps.vars.outputs.flv }}
29+
run: |
30+
make x86_64${{ steps.vars.outputs.flv }}_defconfig
31+
32+
- uses: actions/download-artifact@v4
33+
with:
34+
pattern: "artifact-*"
35+
merge-multiple: true
36+
37+
- name: Restore x86-64${{ steps.vars.outputs.flv }} output/
38+
run: |
39+
ls -l
40+
mkdir -p output
41+
mv infix-x86_64.tar.gz output/
42+
cd output/
43+
tar xf infix-x86_64.tar.gz
44+
ln -s infix-x86_64 images
45+
46+
- name: Regression Test x86_64${{ steps.vars.outputs.flv }}
47+
run: |
48+
make test
49+
50+
- name: Publish Test Result for x86_64${{ steps.vars.outputs.flv }}
51+
# Ensure this runs even if Regression Test fails
52+
if: always()
53+
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
54+
55+
- name: Generate Test Report for x86_64${{ steps.vars.outputs.flv }}
56+
# Ensure this runs even if Regression Test fails
57+
if: always()
58+
run: |
59+
asciidoctor-pdf \
60+
--theme test/9pm/report/theme.yml \
61+
-a pdf-fontsdir=test/9pm/report/fonts \
62+
test/.log/last/report.adoc \
63+
-o test/.log/last/report.pdf
64+
65+
- name: Upload Test Report as Artifact
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: test-report
69+
path: test/.log/last/report.pdf
70+

.github/workflows/trigger.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Self Trigger
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled]
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-infix:
13+
strategy:
14+
matrix:
15+
target: [aarch64, x86_64]
16+
17+
uses: ./.github/workflows/build.yml
18+
with:
19+
target: ${{ matrix.target }}

0 commit comments

Comments
 (0)