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