Skip to content

Migrate CI from Cirrus CI to GitHub Actions. #1

Migrate CI from Cirrus CI to GitHub Actions.

Migrate CI from Cirrus CI to GitHub Actions. #1

Workflow file for this run

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: Free disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet \
/opt/ghc /usr/local/.ghcup /opt/hostedtoolcache
df -h /
- name: Start container (Fedora)
if: matrix.os == 'fedora'
run: |
podman run -d --name $CONTAINER_NAME \
--privileged --cgroupns=host \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-v $GITHUB_WORKSPACE:/root/ovn-heater \
${{ matrix.image }} /sbin/init
- name: Bootstrap container (Ubuntu)
if: matrix.os == 'ubuntu'
run: |
podman run -d --name ${CONTAINER_NAME}-bootstrap \
${{ matrix.image }} sleep infinity
podman exec ${CONTAINER_NAME}-bootstrap bash -c \
"apt-get update && apt-get install -y systemd dbus"
podman commit ${CONTAINER_NAME}-bootstrap \
localhost/ci-ubuntu-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-ubuntu-systemd /sbin/init
- 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