Skip to content

Commit 89d2da9

Browse files
committed
CI: Add NixOS test
Signed-off-by: Hanno Becker <[email protected]>
1 parent 9bad988 commit 89d2da9

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,60 @@ jobs:
559559
lint: false
560560
verbose: true
561561
secrets: inherit
562+
compatibility_tests:
563+
strategy:
564+
max-parallel: 4
565+
fail-fast: false
566+
matrix:
567+
container:
568+
- id: debian:bullseye
569+
- id: debian:bookworm
570+
- id: nixos/nix:latest
571+
nix_shell: 'nix-shell -p python3 gcc gnumake perl'
572+
name: Compatibility tests (${{ matrix.container.id }})
573+
runs-on: ubuntu-latest
574+
container:
575+
${{ matrix.container.id }}
576+
steps:
577+
# We're not using the checkout action here because on it's not supported
578+
# on all containers we want to test. Resort to a manual checkout.
579+
580+
# We can't hoist this into an action since calling an action can only
581+
# be done after checkout.
582+
- name: Manual checkout
583+
shell: bash
584+
run: |
585+
if (which yum > /dev/null); then
586+
yum install git -y
587+
elif (which apt > /dev/null); then
588+
apt update
589+
apt install git -y
590+
fi
591+
592+
git config --global --add safe.directory $GITHUB_WORKSPACE
593+
git init
594+
git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY
595+
git fetch origin --depth 1 $GITHUB_SHA
596+
git checkout FETCH_HEAD
597+
- uses: ./.github/actions/setup-os
598+
with:
599+
sudo: ""
600+
- name: make quickcheck
601+
shell: bash
602+
run: |
603+
if [ -n "${{ matrix.container.nix_shell }}" ]; then
604+
${{ matrix.container.nix_shell }} --run "CC=gcc OPT=0 make quickcheck && make clean >/dev/null && CC=gcc OPT=1 make quickcheck"
605+
else
606+
CC=gcc OPT=0 make quickcheck
607+
make clean >/dev/null
608+
CC=gcc OPT=1 make quickcheck
609+
fi
610+
- name: Functional Tests
611+
uses: ./.github/actions/multi-functest
612+
with:
613+
nix-shell: ""
614+
custom_shell: ${{ matrix.container.nix_shell && format('{0} --run \"bash -e {{0}}\"', matrix.container.nix_shell) || 'bash' }}
615+
gh_token: ${{ secrets.GITHUB_TOKEN }}
562616
check_autogenerated_files:
563617
strategy:
564618
fail-fast: false

0 commit comments

Comments
 (0)