Migrate CI from Cirrus CI to GitHub Actions. #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| integration: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: fedora | |
| image: quay.io/fedora/fedora:43 | |
| - os: ubuntu | |
| image: docker.io/library/ubuntu:24.04 | |
| env: | |
| CONTAINER_NAME: ci | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Bootstrap container | |
| run: | | |
| podman run -d --name ${CONTAINER_NAME}-bootstrap \ | |
| ${{ matrix.image }} sleep infinity | |
| if [ "${{ matrix.os }}" = "fedora" ]; then | |
| podman exec ${CONTAINER_NAME}-bootstrap bash -c \ | |
| "dnf install -y systemd" | |
| else | |
| podman exec ${CONTAINER_NAME}-bootstrap bash -c \ | |
| "apt-get update && apt-get install -y systemd dbus" | |
| fi | |
| podman commit ${CONTAINER_NAME}-bootstrap \ | |
| localhost/ci-${{ matrix.os }}-systemd | |
| podman rm -f ${CONTAINER_NAME}-bootstrap | |
| podman run -d --name $CONTAINER_NAME \ | |
| --privileged --cgroupns=host \ | |
| -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ | |
| -v $GITHUB_WORKSPACE:/root/ovn-heater \ | |
| localhost/ci-${{ matrix.os }}-systemd \ | |
| /usr/lib/systemd/systemd | |
| - name: Wait for systemd | |
| run: | | |
| for i in $(seq 1 30); do | |
| if podman exec $CONTAINER_NAME \ | |
| systemctl is-system-running --wait 2>/dev/null | \ | |
| grep -qE 'running|degraded'; then | |
| echo "systemd is ready" | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "Timed out waiting for systemd" | |
| exit 1 | |
| - name: Run tests | |
| run: | | |
| podman exec $CONTAINER_NAME \ | |
| bash /root/ovn-heater/.ci/ci.sh ${{ matrix.os }} | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: test_results/ | |
| if-no-files-found: ignore | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| podman rm -f $CONTAINER_NAME || true |