diff --git a/.github/actions/test_with_valgrind/action.yml b/.github/actions/test_with_valgrind/action.yml new file mode 100644 index 000000000..f15544ea1 --- /dev/null +++ b/.github/actions/test_with_valgrind/action.yml @@ -0,0 +1,88 @@ +name: Run package tests +description: Run package tests +inputs: + NO_COVERAGE: + description: set to a non-empty string to suppress gathering coverage + required: false + type: string + default: "" + GAP_TESTFILE: + description: Name of the GAP file to be read for executing the package tests (overrides TestFile in PackageInfo.g) + required: false + type: string + default: "" + only-needed: + description: If set to true then only needed dependencies of the package being tested are loaded + required: false + type: boolean + default: false + pre-gap: + description: Commands to be prepended to gap + required: false + type: string + default: "" + +env: + CHERE_INVOKING: 1 + +runs: + using: composite + steps: + - name: Run tests + run: | + set -ex + + GAPROOT=${GAPROOT-$HOME/gap} + + # set up a custom GAP root containing only this package, so that + # we can force GAP to load the correct version of this package + # (we already did that in build_pkg.sh, but we do it again here, + # to allow the occasional instance where a package wants to also + # run the tests of others packages, by invoking this script multiple + # times in different directories) + mkdir -p /tmp/gaproot/pkg/ + ln -f -s $PWD /tmp/gaproot/pkg/ + + # start GAP with custom GAP root, to ensure correct package version is loaded + GAP="${{ inputs.pre-gap }} $GAPROOT/gap -l /tmp/gaproot; --quitonbreak" + + if ${{ inputs.only-needed }} = 'true' ; then + GAP="$GAP -A" + fi + + # Unless explicitly turned off by setting the NO_COVERAGE environment variable, + # we collect coverage data + if [[ -z "${{ inputs.NO_COVERAGE }}" ]]; then + mkdir -p ${COVDIR-coverage} + GAP="$GAP --cover ${COVDIR-coverage}/$(mktemp XXXXXX).coverage" + fi + + cat > __TEST_RUNNNER__.g <> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$MAMBA_ROOT_PREFIX/envs/digraphs/lib" >> $GITHUB_ENV + echo "CFLAGS=-I$MAMBA_ROOT_PREFIX/envs/digraphs/include" >> $GITHUB_ENV + echo "LDFLAGS=-L$MAMBA_ROOT_PREFIX/envs/digraphs/lib" >> $GITHUB_ENV + - name: Install GAP and clone/compile necessary packages . . . + uses: gap-actions/setup-gap@v2 + with: + GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz + GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface + GAPBRANCH: stable-4.13 + - name: Build Digraphs . . . + uses: gap-actions/build-pkg@v1 + with: + CONFIGFLAGS: ${{ matrix.bliss }} ${{ matrix.planarity }} + - name: Run Digraphs package's tst/teststandard.g . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + + all-options: + name: ${{ matrix.debug }} ${{ matrix.warnings }} ${{ matrix.without-intrinsics }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + warnings: + - "--enable-compile-warnings" + - "" + debug: + - "--enable-debug" + - "" + without-intrinsics: + - "--without-intrinsics" + - "" + exclude: + - warnings: "" + debug: "" + without-intrinsics: "" + + steps: + - uses: actions/checkout@v4 + - name: Output g++ version . . . + run: g++ --version + - name: Install GAP and clone/compile necessary packages . . . + uses: gap-actions/setup-gap@v2 + with: + GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz + GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface + GAPBRANCH: stable-4.13 + - name: Build Digraphs . . . + uses: gap-actions/build-pkg@v1 + with: + CONFIGFLAGS: ${{ matrix.debug }} ${{ matrix.without-intrinsics }} ${{ matrix.warnings && '--enable-compile-warnings WARNING_CXXFLAGS="-Werror" WARNING_CFLAGS="-Werror"' || '' }} + - name: Run Digraphs package's tst/teststandard.g . . . + uses: gap-actions/run-pkg-tests@v2 diff --git a/.github/workflows/gap.yml b/.github/workflows/gap.yml deleted file mode 100644 index 4e1bc5913..000000000 --- a/.github/workflows/gap.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: "GAP" -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - - stable-*.* - schedule: - # Every day at 3:30 AM UTC - - cron: '30 3 * * *' - -env: - DIGRAPHS_LIB: digraphs-lib-0.6 - -jobs: - test-unix: - name: "${{ matrix.os }}${{ matrix.ABI }} / GAP ${{ matrix.gap-branch }}" - runs-on: "${{ matrix.os }}-latest" - strategy: - fail-fast: false - matrix: - os: - - ubuntu - gap-branch: - - master - - stable-4.11 - - stable-4.12 - - stable-4.13 - pkgs-to-clone: - - NautyTracesInterface - ABI: [''] - - include: - - gap-branch: stable-4.10 - os: ubuntu - - gap-branch: master - pkgs-to-clone: "NautyTracesInterface" - os: macos - - gap-branch: master - os: ubuntu - ABI: 32 - - steps: - - uses: actions/checkout@v4 - - name: "Install dependencies" - if: ${{ runner.os == 'macOS' }} - run: brew install automake - - name: "Install GAP and clone/compile necessary packages" - uses: gap-actions/setup-gap@v2 - with: - GAP_PKGS_TO_CLONE: "${{ matrix.pkgs-to-clone }}" - GAP_PKGS_TO_BUILD: "io orb profiling grape NautyTracesInterface datastructures" - GAPBRANCH: ${{ matrix.gap-branch }} - ABI: ${{ matrix.ABI }} - - name: "Build Digraphs" - uses: gap-actions/build-pkg@v1 - with: - ABI: ${{ matrix.ABI }} - - name: "Install digraphs-lib" - run: | - curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz" - tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz" - - name: "Clone datastructures v0.3.0" - if: ${{ matrix.gap-branch == 'stable-4.10' }} - run: | - rm -rf $HOME/gap/pkg/datastructures - cd $HOME/gap/pkg/ - git clone https://github.com/gap-packages/datastructures.git datastructures - cd datastructures - git checkout v0.3.0 - ./configure - make - - name: "Run DigraphsTestInstall" - uses: gap-actions/run-pkg-tests@v2 - with: - GAP_TESTFILE: "tst/github_actions/install.g" - - name: "Run DigraphsTestStandard" - uses: gap-actions/run-pkg-tests@v2 - with: - GAP_TESTFILE: "tst/github_actions/standard.g" - - name: "Run DigraphsTestManualExamples" - uses: gap-actions/run-pkg-tests@v2 - with: - GAP_TESTFILE: "tst/github_actions/examples.g" - - name: "Run DigraphsTestExtreme" - uses: gap-actions/run-pkg-tests@v2 - with: - GAP_TESTFILE: "tst/github_actions/extreme.g" - - uses: gap-actions/process-coverage@v2 - - uses: codecov/codecov-action@v3 - - test-cygwin: - name: "cygwin / GAP master" - runs-on: windows-2019 - env: - CHERE_INVOKING: 1 - steps: - - uses: actions/checkout@v4 - - uses: gap-actions/setup-cygwin@v1 - - uses: gap-actions/setup-gap@cygwin-v2 - with: - GAP_PKGS_TO_BUILD: "io orb profiling grape datastructures" - - uses: gap-actions/build-pkg@cygwin-v1 - - name: "Install digraphs-lib" - run: | - curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz" - tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz" - - uses: gap-actions/run-pkg-tests@cygwin-v2 - - uses: gap-actions/process-coverage@cygwin-v2 - - uses: codecov/codecov-action@v3 - - with-external-planarity-bliss: - runs-on: "ubuntu-latest" - env: - GAPBRANCH: "stable-4.12" - ABI: 64 - PKG_CONFIG_PATH: "/home/runner/micromamba/envs/digraphs/lib/pkgconfig:/home/runner/micromamba/envs/digraphs/share/pkgconfig/" - LD_LIBRARY_PATH: "/home/runner/micromamba/envs/digraphs/lib" - CFLAGS: "-I/home/runner/micromamba/envs/digraphs/include" - LDFLAGS: "-L/home/runner/micromamba/envs/digraphs/lib" - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v4 - - name: "Install micromamba environment from environment.yml . . ." - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: environment.yml - cache-environment: true - - name: "Activate \"digraphs\" environment . . ." - run: micromamba activate digraphs - - name: "Install GAP and clone/compile necessary packages" - uses: gap-actions/setup-gap@v2 - with: - GAP_PKGS_TO_BUILD: "io orb profiling grape datastructures" - - name: "Build Digraphs" - uses: gap-actions/build-pkg@v1 - with: - CONFIGFLAGS: --with-external-planarity --with-external-bliss - - name: "Run Digraphs package's tst/teststandard.g" - uses: gap-actions/run-pkg-tests@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bc660dc44..4c3121a91 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: "Lint" +name: Lint on: workflow_dispatch: pull_request: @@ -8,11 +8,11 @@ on: - stable-*.* schedule: # Every day at 3:30 AM UTC - - cron: '30 3 * * *' + - cron: 30 3 * * * jobs: lint: - name: "${{ matrix.linter }}" + name: ${{ matrix.linter }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -21,12 +21,11 @@ jobs: - gaplint - cpplint steps: - - name: "Check out the repository" - uses: actions/checkout@v4 - - name: "Set up Python" - uses: actions/setup-python@v5 - - name: "Install ${{ matrix.linter }} with pip" - run: pip install ${{ matrix.linter }} - - name: "Run ${{ matrix.linter }} on the Digraphs package" - run: bash etc/${{ matrix.linter }}.sh - + - name: Check out the repository . . . + uses: actions/checkout@v4 + - name: Set up Python . . . + uses: actions/setup-python@v5 + - name: Install ${{ matrix.linter }} with pip . . . + run: pip install ${{ matrix.linter }} + - name: Run ${{ matrix.linter }} on the Digraphs package . . . + run: bash etc/${{ matrix.linter }}.sh diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 4f4b44917..19690801a 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1,4 +1,4 @@ -name: "Manual" +name: Manual on: workflow_dispatch: pull_request: @@ -8,15 +8,15 @@ on: - stable-*.* schedule: # Every day at 3:20 AM UTC - - cron: '20 3 * * *' + - cron: "20 3 * * *" jobs: manual: - name: "compile and upload manual" + name: compile and upload manual runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: "Install TeX Live" + - name: Install TeX Live . . . run: | packages=( texlive-latex-base @@ -30,14 +30,14 @@ jobs: sudo apt-get install "${packages[@]}" - uses: gap-actions/setup-gap@v2 env: - GAP_BOOTSTRAP: "minimal" + GAP_BOOTSTRAP: minimal with: - GAP_PKGS_TO_BUILD: '' + GAP_PKGS_TO_BUILD: "" - uses: gap-actions/build-pkg-docs@v1 - - name: "Upload compiled manuals" + - name: Upload compiled manuals . . . uses: actions/upload-artifact@v4 with: - name: "Digraphs manual" + name: Digraphs manual retention-days: 7 path: | doc/manual.pdf diff --git a/.github/workflows/os.yml b/.github/workflows/os.yml new file mode 100644 index 000000000..7a19903e8 --- /dev/null +++ b/.github/workflows/os.yml @@ -0,0 +1,97 @@ +name: OS +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + - stable-*.* + schedule: + # Every day at 3:30 AM UTC + - cron: 30 3 * * * + +env: + DIGRAPHS_LIB: digraphs-lib-0.6 + NO_COVERAGE: true + +jobs: + test-unix: + name: ${{ matrix.os }}${{ matrix.ABI }} / GAP stable-4.13 + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu + ABI: 32 + pkgs-to-clone: digraphs/graphviz + pkgs-to-build: io orb datastructures grape + - os: macos + ABI: "" + pkgs-to-clone: NautyTracesInterface digraphs/graphviz + pkgs-to-build: io orb datastructures grape NautyTracesInterface + + steps: + - uses: actions/checkout@v4 + - name: Output g++ version . . . + run: g++ --version + - name: Install macOS dependencies . . . + if: ${{ runner.os == 'macOS' }} + run: brew install automake + - name: Install GAP and clone/compile necessary packages . . . + uses: gap-actions/setup-gap@v2 + with: + GAP_PKGS_TO_CLONE: ${{ matrix.pkgs-to-clone }} + GAP_PKGS_TO_BUILD: ${{ matrix.pkgs-to-build }} + GAPBRANCH: stable-4.13 + ABI: ${{ matrix.ABI }} + - name: Build Digraphs . . . + uses: gap-actions/build-pkg@v1 + with: + ABI: ${{ matrix.ABI }} + - name: Install digraphs-lib . . . + run: | + curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz" + tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz" + - name: Run DigraphsTestInstall . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/install.g + - name: Run DigraphsTestStandard . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/standard.g + - name: Run DigraphsTestManualExamples . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/examples.g + - name: Run DigraphsTestExtreme . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/extreme.g + + test-cygwin: + name: cygwin / GAP stable-4.13 + runs-on: windows-latest + env: + CHERE_INVOKING: 1 + steps: + - uses: actions/checkout@v4 + - uses: gap-actions/setup-cygwin@v1 + - uses: gap-actions/setup-gap@cygwin-v2 + with: + GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz + GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface + GAPBRANCH: stable-4.13 + - uses: gap-actions/build-pkg@cygwin-v1 + - name: Install digraphs-lib . . . + run: | + curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz" + tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz" + - uses: gap-actions/run-pkg-tests@cygwin-v2 + with: + NO_COVERAGE: true diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 000000000..7083cb5dc --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,79 @@ +name: Ubuntu +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + - stable-*.* + schedule: + # Every day at 3:30 AM UTC + - cron: 30 3 * * * + +env: + DIGRAPHS_LIB: digraphs-lib-0.6 + NO_COVERAGE: true + +jobs: + test-unix: + name: Ubuntu / GAP ${{ matrix.gap-branch }} / ${{ matrix.only-needed && 'only-needed' || 'needed+suggested' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + gap-branch: + - master + - stable-4.11 + - stable-4.12 + - stable-4.13 + only-needed: + - true + - false + include: + - only-needed: true + pkgs-to-clone: digraphs/graphviz + pkgs-to-build: io orb datastructures + - only-needed: false + pkgs-to-clone: NautyTracesInterface digraphs/graphviz + pkgs-to-build: io orb datastructures grape NautyTracesInterface + + steps: + - uses: actions/checkout@v4 + - name: Output g++ version . . . + run: g++ --version + - name: Install GAP and clone/compile necessary packages . . . + uses: gap-actions/setup-gap@v2 + with: + GAP_PKGS_TO_CLONE: ${{ matrix.pkgs-to-clone }} + GAP_PKGS_TO_BUILD: ${{ matrix.pkgs-to-build }} + GAPBRANCH: ${{ matrix.gap-branch }} + - name: Build Digraphs . . . + uses: gap-actions/build-pkg@v1 + - name: Install digraphs-lib . . . + run: | + curl --retry 5 -L -O "https://digraphs.github.io/Digraphs/${{ env.DIGRAPHS_LIB }}.tar.gz" + tar xf "${{ env.DIGRAPHS_LIB }}.tar.gz" + - name: Run DigraphsTestInstall . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/install.g + only-needed: ${{ matrix.only-needed }} + - name: Run DigraphsTestStandard . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/standard.g + only-needed: ${{ matrix.only-needed }} + - name: Run DigraphsTestManualExamples . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/examples.g + only-needed: ${{ matrix.only-needed }} + - name: Run DigraphsTestExtreme . . . + uses: gap-actions/run-pkg-tests@v2 + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/extreme.g + only-needed: ${{ matrix.only-needed }} diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 000000000..0fa0315e3 --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,43 @@ +name: Valgrind +on: + workflow_dispatch: + release: + types: [created] + +env: + VALGRIND: valgrind --trace-children=yes --leak-check=full --error-exitcode=1 + NO_COVERAGE: true + +jobs: + test-valgrind: + name: Ubuntu / GAP stable-4.13 / valgrind + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Output g++ version . . . + run: g++ --version + - name: Install Valgrind . . . + run: sudo apt-get install valgrind + - name: Install GAP and clone/compile necessary packages . . . + uses: gap-actions/setup-gap@v2 + with: + GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz + GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface + GAPBRANCH: stable-4.13 + CONFIGFLAGS: --enable-valgrind + - name: Build Digraphs . . . + uses: gap-actions/build-pkg@v1 + - name: Run DigraphsTestInstall . . . + # TODO: Replace below with gap-actions/run-pkg-tests@v2 if the functionality gets added + uses: ./.github/actions/test_with_valgrind + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/install.g + pre-gap: ${{ env.VALGRIND }} + - name: Run DigraphsTestStandard . . . + # TODO: Replace below with gap-actions/run-pkg-tests@v2 if the functionality gets added + uses: ./.github/actions/test_with_valgrind + with: + NO_COVERAGE: true + GAP_TESTFILE: tst/github_actions/standard.g + pre-gap: ${{ env.VALGRIND }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 927cfa82a..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,81 +0,0 @@ -pr: -- main -- stable-*.* - -trigger: -- main -- stable-*.* - -pool: - vmImage: 'ubuntu-latest' - -variables: - DIGRAPHS_LIB: digraphs-lib-0.6 - -jobs: -# TODO reinstate when this Docker container works again/we have a replacement -#- job: ABI_64_GAP_master_PACKAGES_latest -# variables: -# SUITE: test -# ABI: 64 -# GAP_VERSION: master -# PACKAGES: latest -# steps: -# - script: ci/azure-gap.sh -# displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -# TODO there isn't a GAP master 32 docker container yet -# - job: ABI_32_GAP_master_PACKAGES_latest -# variables: -# SUITE: test -# ABI: 32 -# GAP_VERSION: master -# PACKAGES: latest -# steps: -# - script: ci/azure-gap.sh -# displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -- job: ABI_64_GAP_411_PACKAGES_latest - variables: - SUITE: test - ABI: 64 - GAP_VERSION: 4.11.0 - PACKAGES: latest - steps: - - script: ci/azure-gap.sh - displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -- job: ABI_32_GAP_411_PACKAGES_latest - variables: - SUITE: test - ABI: 32 - GAP_VERSION: 4.11.0 - PACKAGES: latest - steps: - - script: ci/azure-gap.sh - displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -- job: ABI_64_GAP_410_PACKAGES_required - variables: - SUITE: test - ABI: 64 - GAP_VERSION: 4.10.2 - PACKAGES: required - steps: - - script: ci/azure-gap.sh - displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -- job: ABI_32_GAP_410_PACKAGES_required - variables: - SUITE: test - ABI: 32 - GAP_VERSION: 4.10.2 - PACKAGES: required - steps: - - script: ci/azure-gap.sh - displayName: 'Running the Digraphs package for GAP tests in docker container. . .' -- job: coverage - variables: - SUITE: coverage - ABI: 64 - GAP_VERSION: 4.11.0 - PACKAGES: latest - THRESHOLD: 98 - steps: - - script: ci/azure-gap.sh - displayName: 'Running the Digraphs package for GAP tests in docker container. . .' diff --git a/ci/azure-gap.sh b/ci/azure-gap.sh deleted file mode 100755 index 101313582..000000000 --- a/ci/azure-gap.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -e - -if [ "$GAP_VERSION" == "master" ]; then - CONTAINER_NAME="gapsystem/gap-docker-master" -else - CONTAINER_NAME_BASE="jamesdbmitchell/gap-docker-minimal" - if [ "$ABI" == "32" ]; then - CONTAINER_NAME_BASE="$CONTAINER_NAME_BASE-32" - fi - CONTAINER_NAME="$CONTAINER_NAME_BASE:version-$GAP_VERSION" -fi - -# Pull the docker container -docker pull $CONTAINER_NAME - -# Start the docker container detached -ID=$(docker run --rm -i -d -e SUITE -e PACKAGES -e ABI -e DIGRAPHS_LIB -e GAP_VERSION -e THRESHOLD "$CONTAINER_NAME") - -# Get the GAP home directly from the container -GAP_HOME=$(docker exec $ID bash -c 'echo "$GAP_HOME"') - -# Copy the digraphs directory into the container -docker cp . $ID:$GAP_HOME/pkg/digraphs - -# Run the ci/docker-test.sh script in the running container -docker exec -i $ID "$GAP_HOME/pkg/digraphs/ci/docker-test.sh" ; exit - -# Attach to the container -docker attach $ID diff --git a/ci/coverage.py b/ci/coverage.py deleted file mode 100755 index b6657b5a6..000000000 --- a/ci/coverage.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 - -import tempfile, subprocess, sys, os, ntpath, re -from os.path import exists, isdir, isfile - -_BLUE_PREFIX = '\033[34m' -_RED_PREFIX = '\033[31m' -_RESET = '\033[0m' -_ERR_PREFIX = _RED_PREFIX + 'coverage.py: error: ' -_WARN_PREFIX = _RED_PREFIX + 'coverage.py: warning: ' - -def error_exit(msg): - print(_ERR_PREFIX + msg + _RESET) - sys.exit(1) - -def warn_exit(msg): - print(_WARN_PREFIX + msg + _RESET) - sys.exit(0) - -if len(sys.argv) != 3: - error_exit('arguments must be a test file and the threshold') - -f = str(sys.argv[1]) -if not (exists(f) and isfile(f)): - error_exit(f + ' does not exist!') - -threshold = int(sys.argv[2]) - -_DIR = tempfile.mkdtemp() -_COMMANDS = 'LoadPackage("digraphs", false); Test("' + f + '");;' -_COMMANDS += 'outdir := "' + _DIR + '";;' -_COMMANDS += ''' -UncoverageLineByLine();; -LoadPackage("profiling", false);; -filesdir := Concatenation(DIGRAPHS_Dir(), "/gap/");; -x := ReadLineByLineProfile(Concatenation(outdir, "/profile.gz"));; -OutputAnnotatedCodeCoverageFiles(x, filesdir, outdir); -QUIT_GAP(0); -''' - -_RUN_GAP = '../../gap -A -q -m 1g -o 2g -T --cover ' + _DIR + '/profile.gz -c "' + _COMMANDS.replace('"', '\\"') + '"' - -try: - pro = subprocess.Popen(_RUN_GAP, shell=True) - pro.wait() -except KeyboardInterrupt: - pro.terminate() - pro.wait() - error_exit('Killed!') -except (subprocess.CalledProcessError, IOError, OSError): - error_exit('Something went wrong calling GAP!') - -filename = _DIR + '/index.html' -if not (exists(filename) and isfile(filename)): - error_exit('Failed to find file://' + filename) - -gi_file = ntpath.basename(f).split('.')[0] + '.gi' -for line in open(filename): - if gi_file in line: - break - -search = re.search('coverage\d\d+[\'"]>(\d+)([\d,]+)([\d,]+)', line) -if search == None: - warn_exit('Could not find .gi file to which this .tst refers') - -percentage = search.group(1) -print(_BLUE_PREFIX + gi_file + ' has ' + percentage + '% coverage: ' + search.group(2) + '/' + search.group(3) + ' lines' + _RESET) - -if int(percentage) < threshold: - warn_exit(percentage + '% is insufficient code coverage for ' + gi_file) diff --git a/ci/docker-test.sh b/ci/docker-test.sh deleted file mode 100755 index 9112abdab..000000000 --- a/ci/docker-test.sh +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -# This script is intended to be run inside a docker container -# that already has GAP installed - -bold() { - printf "\033[1m%s\033[0m\n" "$*" -} - -################################################################################ -# Check required environment variables are set -################################################################################ - -if [[ -z "${SUITE}" ]] ; then - bold "Error, environment variable SUITE is undefined" - exit 1 -fi - -if [[ -z "${GAP_HOME}" ]] ; then - bold "Error, environment variable GAP_HOME is undefined" - exit 1 -fi - -if [[ -z "${GAP_VERSION}" ]] ; then - bold "Error, environment variable GAP_VERSION is undefined" - exit 1 -fi - -if [[ -z "${DIGRAPHS_LIB}" ]] ; then - bold "Error, environment variable GAP_VERSION is undefined" - exit 1 -fi - -if [[ -z "${PACKAGES}" ]] ; then - bold "Error, environment variable GAP_VERSION is undefined" - exit 1 -fi - -if [ "$SUITE" == "coverage" ] && [ -z "${THRESHOLD}" ] ; then - bold "Error, environment variable THRESHOLD is undefined" - exit 1 -fi - -if [ "$SUITE" != "test" ] && [ "$SUITE" != "coverage" ] ; then - bold "Error, unrecognised suite: $SUITE" - exit 1 -fi - -env | grep -v "^LS_COLORS" - -################################################################################ -# Define globals -################################################################################ - -# Common curl settings -CURL="curl --connect-timeout 5 --max-time 40 --retry 5 --retry-delay 0 -L" -TESTLOG="$GAP_HOME/testlog.txt" -GAPSH="$GAP_HOME/gap" -DIG_DIR="$GAP_HOME/pkg/digraphs" - -################################################################################ -# Install system dependencies -################################################################################ - -bold "Installing dependencies (apt-get). . ." -sudo apt-get --yes update -sudo apt-get install libtool curl git xdg-utils --yes - -if [ "$GAP_VERSION" == "master" ]; then - # Stops the documentation from failing to compile because enumitem.sty isn't - # available - sudo apt-get remove texlive-latex-base --yes -fi - -if [ "$SUITE" == "coverage" ]; then - sudo apt-get install python3 --yes -fi - -bold "Fixing permissions . . . " -sudo chown -R gap: $GAP_HOME/pkg/digraphs - -################################################################################ -# Compile Digraphs and install Digraphs lib -################################################################################ - -bold "Compiling the Digraphs package..." -cd "$GAP_HOME/pkg/digraphs" - -aclocal --version -autoconf --version -autoheader --version - -./autogen.sh -./configure $PKG_FLAGS $EXTRA_PKG_FLAGS -make - -bold "Downloading $DIGRAPHS_LIB..." -$CURL -O https://digraphs.github.io/Digraphs/$DIGRAPHS_LIB.tar.gz -tar xf $DIGRAPHS_LIB.tar.gz -rm $DIGRAPHS_LIB.tar.gz - -################################################################################ -# Install gap dependencies -################################################################################ - -bold "Installing GAP dependencies . . ." -PKGS=( "io" "orb" "datastructures" ) -if [ "$GRAPE" != "no" ]; then - PKGS+=( "grape" ) -fi -if [ "$SUITE" == "coverage" ]; then - PKGS+=( "profiling" ) -fi -# We now need a newer GAPDoc than the one included in the Docker container for GAP 4.10.2 -if [ "$GAP_VERSION" == "4.10.2" ]; then - PKGS+=( "GAPDoc" ) -fi - -for PKG in "${PKGS[@]}"; do - cd $GAP_HOME/pkg - - # Get the relevant version number - if [ "${PACKAGES[0]}" == "latest" ] || [ "$PKG" == "profiling" ]; then - VERSION=`$CURL -s "https://api.github.com/repos/gap-packages/${PKG}/releases" | grep tag_name | head -n 1 | awk -F'"' '{print $4}'` - else - VERSION=`grep "\"$PKG\"" $GAP_HOME/pkg/digraphs/PackageInfo.g | awk -F'"' '{print $4}' | cut -c3-` - fi - - if [ -z $VERSION ]; then - bold "Could not determine the version number of the package $PKG!! Aborting..." - exit 1 - elif [ "${VERSION:0:1}" == "v" ]; then - VERSION=${VERSION:1} - fi - - # This can be removed when there is no GAPDoc special case for GAP 4.10.2 - if [ "$PKG" == "GAPDoc" ]; then - URL="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/GAPDoc-$VERSION.tar.gz" - else - URL="https://github.com/gap-packages/$PKG/releases/download/v$VERSION/$PKG-$VERSION.tar.gz" - fi - bold "Downloading $PKG-$VERSION (${PACKAGES[0]} version), from URL:" - bold "$URL" - $CURL "$URL" -o $PKG-$VERSION.tar.gz - (tar xf $PKG-$VERSION.tar.gz && rm $PKG-$VERSION.tar.gz) || exit 1 - - if [ -f $PKG-$VERSION/configure ]; then - if [ "$PKG" == "orb" ] || [ "$PKG" == "grape" ] || [ "$PKG" == "datastructures" ]; then - cd $PKG-$VERSION && ./configure && make # orb/grape don't accept flags - else - cd $PKG-$VERSION && ./configure $PKG_FLAGS && make - fi - fi -done - -################################################################################ -## Install NautyTracesInterface -################################################################################ -if [ "$NAUTY" != "no" ]; then - bold "Getting master version of NautyTracesInterface . . ." - git clone -b master --depth=1 https://github.com/gap-packages/NautyTracesInterface.git $GAP_HOME/pkg/nautytraces - cd $GAP_HOME/pkg/nautytraces/nauty2*r* && ./configure $PKG_FLAGS && make - cd $GAP_HOME/pkg/nautytraces && ./autogen.sh && ./configure $PKG_FLAGS && make -fi - -################################################################################ -## Run the tests -touch $GAP_HOME/testlog.txt - -if [ "$SUITE" == "coverage" ]; then - - bold "Performing code coverage tests..." - for TEST in $DIG_DIR/tst/standard/*.tst; do - FILENAME=${TEST##*/} - if [ ! `grep -E "$FILENAME" $DIG_DIR/.covignore` ]; then - $DIG_DIR/ci/coverage.py $TEST $THRESHOLD | tee -a $TESTLOG - else - bold "ignoring $FILENAME, which is listed in .covignore" - fi - done - -elif [ "$SUITE" == "test" ]; then - - # Temporary workaround because of GAP being weird with memory - if [ "$ABI" == "32" ]; then - MEM=1g - elif [ "$ABI" == "64" ]; then - MEM=2g - fi - - cd $DIG_DIR/tst/workspaces - bold "Running SaveWorkspace tests..." - echo "LoadPackage(\"digraphs\"); DigraphsTestInstall(); Test(\"save-workspace.tst\"); quit; quit; quit;" | - $GAPSH -A -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - - bold "Running LoadWorkspace tests..." - echo "Test(\"load-workspace.tst\"); DigraphsTestInstall(); quit; quit; quit;" | - $GAPSH -L test-output.w -A -x 80 -r -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - - bold "Running Digraphs package standard tests and manual examples..." - echo "LoadPackage(\"digraphs\"); DigraphsTestAll();" | - $GAPSH -A -x 80 -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - - if [ ! "$EXTREME" == "no" ]; then - bold "Running Digraphs package extreme tests..." - echo "LoadPackage(\"digraphs\"); DigraphsTestExtreme();" | - $GAPSH -A -x 80 -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - fi -fi - -( ! grep -E "Diff|brk>|#E|Error|Errors detected|# WARNING|Syntax warning|Couldn't open saved workspace|insufficient|WARNING in|FAILED|Total errors found:" $TESTLOG ) diff --git a/environment.yml b/environment.yml deleted file mode 100644 index def1b5cfe..000000000 --- a/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: digraphs - -channels: - - conda-forge - -dependencies: - - bliss - - planarity diff --git a/src/cliques.c b/src/cliques.c index dfd8f319b..d7b556e06 100644 --- a/src/cliques.c +++ b/src/cliques.c @@ -173,7 +173,7 @@ static void init_graph_from_digraph_obj(Graph* const graph, Obj digraph_obj) { Obj adj_mat = FuncADJACENCY_MATRIX(0L, digraph_obj); DIGRAPHS_ASSERT(nr < MAXVERTS); DIGRAPHS_ASSERT(IS_PLIST(adj_mat)); - DIGRAPHS_ASSERT(IS_PLIST(out)); + DIGRAPHS_ASSERT(IS_PLIST(FuncOutNeighbours(0L, digraph_obj))); clear_graph(graph, nr); // Only include symmetric edges