Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
* Build tinyconfig kernels instead of "vanilla" ones for speed
* Have one job build both times instead of duplicating into a second job
* Use diffoscope on the .changes file but ignore the buildinfo file
  • Loading branch information
legoktm committed Apr 1, 2024
1 parent a534217 commit 0d6f913
Showing 1 changed file with 24 additions and 35 deletions.
59 changes: 24 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ name: CI
on: [push, pull_request]

jobs:
vanilla:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- tiny-5.15
- tiny-6.6
# Build twice for comparison
build:
- one
- two
outputs:
artifact_id: ${{ steps.upload.outputs.artifact-id }}
steps:
Expand All @@ -14,57 +24,36 @@ jobs:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make build-essential

- name: Build vanilla kernel
run: make vanilla
- name: Build tiny kernel
run: make ${{ matrix.target }}

- uses: actions/upload-artifact@v4
id: upload
with:
name: build1
path: build
if-no-files-found: error

vanilla2:
runs-on: ubuntu-latest
outputs:
artifact_id: ${{ steps.upload.outputs.artifact-id }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make build-essential

- name: Build vanilla kernel
run: make vanilla

- uses: actions/upload-artifact@v4
id: upload
with:
name: build2
name: ${{ matrix.target }}-${{ matrix.build }}
path: build
if-no-files-found: error

reproducible:
runs-on: ubuntu-latest
container: debian:bookworm
needs:
- vanilla
- vanilla2
- build
strategy:
fail-fast: false
matrix:
target:
- tiny-5.15
- tiny-6.6
steps:
- name: Install dependencies
run: |
apt-get update && apt-get install --yes diffoscope-minimal python3-debian \
--no-install-recommends
- uses: actions/download-artifact@v4
with:
pattern: "*"
pattern: "${{ matrix.target }}*"
- name: diffoscope
run: |
find . -name '*.deb' -exec sha256sum {} \;
# TODO: Ideally we'd just be able to diff the .changes files and let diffoscope find
# all the individual debs, but the source packages are not identical. When they are,
for deb in `find build1/ -name '*.deb' -exec basename {} \;`; do
echo "Diffoscoping $deb"
diffoscope build1/$deb build2/$deb
done;
# We need to exclude .buildinfo because the `Build-Date` will be different
diffoscope ${{ matrix.target }}-one/*.changes ${{ matrix.target }}-two/*.changes --exclude '*.buildinfo'

0 comments on commit 0d6f913

Please sign in to comment.