|
10 | 10 | permissions: |
11 | 11 | contents: read |
12 | 12 |
|
13 | | -env: |
14 | | - GO_TOOLCHAIN: "1.15" |
15 | | - GOPATH: "/opt" |
16 | | - BUILD_DIR: "/opt/src/github.com/coreos/go-systemd" |
17 | | - |
18 | 13 | jobs: |
19 | | - ditro-test: |
| 14 | + distro-test: |
20 | 15 | name: "Distro test" |
21 | | - runs-on: ubuntu-20.04 |
| 16 | + runs-on: ubuntu-latest |
22 | 17 | strategy: |
| 18 | + fail-fast: false |
23 | 19 | matrix: |
24 | 20 | baseimage: ['debian:bullseye', 'ubuntu:20.04', 'ubuntu:22.04'] |
25 | 21 | steps: |
26 | | - - run: sudo apt-get -qq update |
27 | | - - name: Install libsystemd-dev |
28 | | - run: sudo apt-get install libsystemd-dev |
29 | | - - uses: actions/checkout@v3 |
30 | | - - name: Setup go |
31 | | - uses: actions/setup-go@v4 |
32 | | - with: |
33 | | - go-version: ${{ env['GO_TOOLCHAIN'] }} |
34 | | - - name: Go build (source) |
35 | | - run: ./scripts/ci-runner.sh build_source |
36 | | - - name: Go build (tests) |
37 | | - run: ./scripts/ci-runner.sh build_tests |
| 22 | + - uses: actions/checkout@v4 |
38 | 23 | - name: Pull base image - ${{ matrix.baseimage }} |
39 | 24 | run: docker pull ${{ matrix.baseimage }} |
40 | 25 | - name: Install packages for ${{ matrix.baseimage }} |
41 | | - run: docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${{ matrix.baseimage }} /bin/bash -c "export DEBIAN_FRONTEND=noninteractive; apt-get update && apt-get install -y sudo build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container" |
| 26 | + run: docker run --privileged --cidfile=/tmp/cidfile ${{ matrix.baseimage }} /bin/bash -e -c "export DEBIAN_FRONTEND=noninteractive; apt-get update; apt-get install -y sudo build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container" |
42 | 27 | - name: Persist base container |
43 | | - run: docker commit `cat /tmp/cidfile` go-systemd/container-tests |
44 | | - - run: rm -f /tmp/cidfile |
| 28 | + run: | |
| 29 | + docker commit `cat /tmp/cidfile` go-systemd/container-tests |
| 30 | + docker rm -f `cat /tmp/cidfile` |
| 31 | + rm -f /tmp/cidfile |
45 | 32 | - name: Run systemd from ${{ matrix.baseimage }} |
46 | | - run: docker run --shm-size=2gb -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system |
| 33 | + run: docker run --shm-size=2gb -d --cidfile=/tmp/cidfile --privileged -v ${PWD}:/src go-systemd/container-tests /bin/systemd --system |
| 34 | + - name: Fixup git |
| 35 | + run: docker exec --privileged `cat /tmp/cidfile` /bin/bash -e -c 'git config --global --add safe.directory /src' |
| 36 | + - name: Build tests |
| 37 | + run: docker exec --privileged `cat /tmp/cidfile` /bin/bash -e -c 'cd /src; ./scripts/ci-runner.sh build_tests' |
47 | 38 | - name: Wait a bit for the whole system to settle |
48 | 39 | run: sleep 30s |
49 | 40 | - name: Run tests |
50 | | - run: docker exec --privileged `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./scripts/ci-runner.sh run_tests" |
| 41 | + run: docker exec --privileged `cat /tmp/cidfile` /bin/bash -e -c 'cd /src; ./scripts/ci-runner.sh run_tests' |
51 | 42 | - name: Cleanup |
52 | 43 | run: docker kill `cat /tmp/cidfile` |
| 44 | + |
| 45 | + all-done: |
| 46 | + needs: |
| 47 | + - distro-test |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - run: echo "All jobs completed" |
0 commit comments