GitHub Actions: build and test grml-debootstrap in PRs
[grml-debootstrap.git] / .github / workflows / test-build.yml
1 name: test-build
2 on:
3   pull_request:
4 concurrency:
5   group: "${{ github.ref }}"
6   cancel-in-progress: true
7 jobs:
8   build-debian:
9     strategy:
10       # Keep other matrix jobs running, even if one fails.
11       fail-fast: false
12       matrix:
13         host_release:
14         - unstable
15         - trixie
16         - bookworm
17         - bullseye
18
19     # We want a working shell, qemu, python and docker. Specific version should not matter (much).
20     runs-on: ubuntu-latest
21
22     steps:
23     - uses: actions/checkout@v4
24
25     - run: ./tests/gha-build-deb.sh
26       name: "Build .deb for ${{matrix.host_release}}"
27       env:
28         HOST_RELEASE: ${{matrix.host_release}}
29
30     - name: Archive built .deb
31       uses: actions/upload-artifact@v3
32       with:
33         name: deb-${{matrix.host_release}}
34         if-no-files-found: error
35         path: |
36           *.deb
37
38   test-debian:
39     needs: build-debian
40     strategy:
41       # Keep other matrix jobs running, even if one fails.
42       fail-fast: false
43       matrix:
44         host_release:
45         - unstable
46         - trixie
47         - bookworm
48         - bullseye
49
50         release:
51         - trixie
52         - bookworm
53         - bullseye
54         - buster
55         - stretch
56
57         debootstrap:
58         - ''
59         - mmdebstrap
60
61         exclude:
62           # debootstrap in bullseye is too old.
63           - host_release: bullseye
64             release: trixie
65           # unclear how to pass --no-check-gpg to mmdebstrap
66           - release: stretch
67             debootstrap: mmdebstrap
68
69     # We want a working shell, qemu, python and docker. Specific version should not matter (much).
70     runs-on: ubuntu-latest
71
72     steps:
73     - uses: actions/checkout@v4
74
75     - name: Download built deb
76       uses: actions/download-artifact@v3
77       with:
78         name: deb-${{matrix.host_release}}
79
80     - run: ./tests/build-vm-and-test.sh setup
81       name: "Setup test environment"
82
83     - run: ./tests/build-vm-and-test.sh run
84       name: "Build VM image using grml-debootstrap on host ${{matrix.host_release}} for ${{matrix.release}} using debootstrap=${{matrix.debootstrap}}"
85       env:
86         HOST_RELEASE: ${{matrix.host_release}}
87         RELEASE: ${{matrix.release}}
88         DEBOOTSTRAP: ${{matrix.debootstrap}}
89
90     - run: ./tests/build-vm-and-test.sh test
91       name: "Test built VM image for ${{matrix.release}}"
92       env:
93         RELEASE: ${{matrix.release}}
94
95     - name: Archive VM test results
96       uses: actions/upload-artifact@v3
97       with:
98         name: vm-results-${{matrix.host_release}}-${{matrix.release}}-${{matrix.debootstrap}}
99         if-no-files-found: error
100         path: tests/results/