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