Skip to content

Commit c9b186a

Browse files
Refactor CI (#641)
* Add valgrind workflow * Create core * Change matrix structure * Add valgrind job * Edit 4.10 job * Consistent indents * Add os * Add config-options * Make bliss and planarity a matrix * os -> OS * Remove old workflow files * kernel: fix compilation in debug mode * config-options -> Config-options * Remove --enable-code-coverage test * Add NO_COVERAGE * Valgrind only on release * Output g++ version * Add macOS into name of mac-only step * Add graphviz * consistent use of NautyTracesInterface * remove tests for GAP 4.10 * Use stable-4.13 as default * Warning is error when testing warnings * Make names consistent --------- Co-authored-by: James D. Mitchell <jdm3@st-andrews.ac.uk>
1 parent 3b42ed7 commit c9b186a

File tree

15 files changed

+430
-570
lines changed

15 files changed

+430
-570
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Run package tests
2+
description: Run package tests
3+
inputs:
4+
NO_COVERAGE:
5+
description: set to a non-empty string to suppress gathering coverage
6+
required: false
7+
type: string
8+
default: ""
9+
GAP_TESTFILE:
10+
description: Name of the GAP file to be read for executing the package tests (overrides TestFile in PackageInfo.g)
11+
required: false
12+
type: string
13+
default: ""
14+
only-needed:
15+
description: If set to true then only needed dependencies of the package being tested are loaded
16+
required: false
17+
type: boolean
18+
default: false
19+
pre-gap:
20+
description: Commands to be prepended to gap
21+
required: false
22+
type: string
23+
default: ""
24+
25+
env:
26+
CHERE_INVOKING: 1
27+
28+
runs:
29+
using: composite
30+
steps:
31+
- name: Run tests
32+
run: |
33+
set -ex
34+
35+
GAPROOT=${GAPROOT-$HOME/gap}
36+
37+
# set up a custom GAP root containing only this package, so that
38+
# we can force GAP to load the correct version of this package
39+
# (we already did that in build_pkg.sh, but we do it again here,
40+
# to allow the occasional instance where a package wants to also
41+
# run the tests of others packages, by invoking this script multiple
42+
# times in different directories)
43+
mkdir -p /tmp/gaproot/pkg/
44+
ln -f -s $PWD /tmp/gaproot/pkg/
45+
46+
# start GAP with custom GAP root, to ensure correct package version is loaded
47+
GAP="${{ inputs.pre-gap }} $GAPROOT/gap -l /tmp/gaproot; --quitonbreak"
48+
49+
if ${{ inputs.only-needed }} = 'true' ; then
50+
GAP="$GAP -A"
51+
fi
52+
53+
# Unless explicitly turned off by setting the NO_COVERAGE environment variable,
54+
# we collect coverage data
55+
if [[ -z "${{ inputs.NO_COVERAGE }}" ]]; then
56+
mkdir -p ${COVDIR-coverage}
57+
GAP="$GAP --cover ${COVDIR-coverage}/$(mktemp XXXXXX).coverage"
58+
fi
59+
60+
cat > __TEST_RUNNNER__.g <<EOF
61+
62+
GAP_TESTFILE:="${{ inputs.GAP_TESTFILE }}";
63+
Read("PackageInfo.g");
64+
info := GAPInfo.PackageInfoCurrent;
65+
if IsEmpty(GAP_TESTFILE) or not IsExistingFile(GAP_TESTFILE) then
66+
GAP_TESTFILE := info.TestFile;
67+
fi;
68+
# Load the package with debug info
69+
SetInfoLevel(InfoPackageLoading, PACKAGE_DEBUG);
70+
SetPackagePath(info.PackageName, "/tmp/gaproot/pkg/$(basename $PWD)");
71+
if ${{ inputs.only-needed }} = true then
72+
LoadPackage(info.PackageName : OnlyNeeded);
73+
else
74+
LoadPackage(info.PackageName);
75+
fi;
76+
SetInfoLevel(InfoPackageLoading, PACKAGE_ERROR);
77+
Print("Now running tests from ", GAP_TESTFILE, "\n");
78+
if EndsWith(GAP_TESTFILE, ".tst") then
79+
QUIT_GAP(Test(GAP_TESTFILE, rec(compareFunction := "uptowhitespace")));
80+
else
81+
Read(GAP_TESTFILE);
82+
Error("Package TestFile did not exit gap");
83+
fi;
84+
EOF
85+
86+
$GAP __TEST_RUNNNER__.g
87+
88+
shell: bash

.github/workflows/codespell.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: codespell
1+
name: Codespell
22
on:
33
workflow_dispatch:
44
pull_request:
@@ -10,5 +10,5 @@ jobs:
1010
codespell:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: codespell-project/actions-codespell@v2
13+
- uses: actions/checkout@v4
14+
- uses: codespell-project/actions-codespell@v2
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Config-options
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- stable-*.*
9+
schedule:
10+
# Every day at 3:30 AM UTC
11+
- cron: 30 3 * * *
12+
env:
13+
NO_COVERAGE: true
14+
15+
jobs:
16+
with-external-planarity-bliss:
17+
name: ${{ matrix.bliss }} ${{ matrix.planarity }}
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
planarity:
23+
- --with-external-planarity
24+
- ""
25+
bliss:
26+
- --with-external-bliss
27+
- ""
28+
exclude:
29+
- planarity: ""
30+
bliss: ""
31+
defaults:
32+
run:
33+
shell: bash -l {0}
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Output g++ version . . .
37+
run: g++ --version
38+
- name: Install micromamba environment from environment.yml . . .
39+
uses: mamba-org/setup-micromamba@v1
40+
with:
41+
environment-name: digraphs
42+
cache-environment: true
43+
create-args: ${{ matrix.bliss && 'bliss' || '' }} ${{ matrix.planarity && 'planarity' || ''}}
44+
- name: Set environment variables . . .
45+
run: |
46+
echo "PKG_CONFIG_PATH=$MAMBA_ROOT_PREFIX/envs/digraphs/lib/pkgconfig:$MAMBA_ROOT_PREFIX/envs/digraphs/share/pkgconfig" >> $GITHUB_ENV
47+
echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/digraphs/lib" >> $GITHUB_ENV
48+
echo "CFLAGS=-I$MAMBA_ROOT_PREFIX/envs/digraphs/include" >> $GITHUB_ENV
49+
echo "LDFLAGS=-L$MAMBA_ROOT_PREFIX/envs/digraphs/lib" >> $GITHUB_ENV
50+
- name: Install GAP and clone/compile necessary packages . . .
51+
uses: gap-actions/setup-gap@v2
52+
with:
53+
GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz
54+
GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface
55+
GAPBRANCH: stable-4.13
56+
- name: Build Digraphs . . .
57+
uses: gap-actions/build-pkg@v1
58+
with:
59+
CONFIGFLAGS: ${{ matrix.bliss }} ${{ matrix.planarity }}
60+
- name: Run Digraphs package's tst/teststandard.g . . .
61+
uses: gap-actions/run-pkg-tests@v2
62+
with:
63+
NO_COVERAGE: true
64+
65+
all-options:
66+
name: ${{ matrix.debug }} ${{ matrix.warnings }} ${{ matrix.without-intrinsics }}
67+
runs-on: ubuntu-latest
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
warnings:
72+
- "--enable-compile-warnings"
73+
- ""
74+
debug:
75+
- "--enable-debug"
76+
- ""
77+
without-intrinsics:
78+
- "--without-intrinsics"
79+
- ""
80+
exclude:
81+
- warnings: ""
82+
debug: ""
83+
without-intrinsics: ""
84+
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Output g++ version . . .
88+
run: g++ --version
89+
- name: Install GAP and clone/compile necessary packages . . .
90+
uses: gap-actions/setup-gap@v2
91+
with:
92+
GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz
93+
GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface
94+
GAPBRANCH: stable-4.13
95+
- name: Build Digraphs . . .
96+
uses: gap-actions/build-pkg@v1
97+
with:
98+
CONFIGFLAGS: ${{ matrix.debug }} ${{ matrix.without-intrinsics }} ${{ matrix.warnings && '--enable-compile-warnings WARNING_CXXFLAGS="-Werror" WARNING_CFLAGS="-Werror"' || '' }}
99+
- name: Run Digraphs package's tst/teststandard.g . . .
100+
uses: gap-actions/run-pkg-tests@v2

.github/workflows/gap.yml

Lines changed: 0 additions & 143 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Lint"
1+
name: Lint
22
on:
33
workflow_dispatch:
44
pull_request:
@@ -8,11 +8,11 @@ on:
88
- stable-*.*
99
schedule:
1010
# Every day at 3:30 AM UTC
11-
- cron: '30 3 * * *'
11+
- cron: 30 3 * * *
1212

1313
jobs:
1414
lint:
15-
name: "${{ matrix.linter }}"
15+
name: ${{ matrix.linter }}
1616
runs-on: ubuntu-latest
1717
strategy:
1818
fail-fast: false
@@ -21,12 +21,11 @@ jobs:
2121
- gaplint
2222
- cpplint
2323
steps:
24-
- name: "Check out the repository"
25-
uses: actions/checkout@v4
26-
- name: "Set up Python"
27-
uses: actions/setup-python@v5
28-
- name: "Install ${{ matrix.linter }} with pip"
29-
run: pip install ${{ matrix.linter }}
30-
- name: "Run ${{ matrix.linter }} on the Digraphs package"
31-
run: bash etc/${{ matrix.linter }}.sh
32-
24+
- name: Check out the repository . . .
25+
uses: actions/checkout@v4
26+
- name: Set up Python . . .
27+
uses: actions/setup-python@v5
28+
- name: Install ${{ matrix.linter }} with pip . . .
29+
run: pip install ${{ matrix.linter }}
30+
- name: Run ${{ matrix.linter }} on the Digraphs package . . .
31+
run: bash etc/${{ matrix.linter }}.sh

0 commit comments

Comments
 (0)