diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef27e5145..725ef3b41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: schedule: # Every day at 3:15 AM UTC - cron: '15 3 * * *' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: diff --git a/.github/workflows/workspaces.yml b/.github/workflows/workspaces.yml new file mode 100644 index 000000000..a529fa647 --- /dev/null +++ b/.github/workflows/workspaces.yml @@ -0,0 +1,70 @@ +# This is temporary until/if: +# https://github.com/gap-actions/run-pkg-tests/pull/24 +# is merged, or something equivalent, then remove the script ci/run-tests.sh, +# and use the save/load.g files as commented out below +name: "Workspaces" +on: + workflow_dispatch: + pull_request: + push: + branches: + - "main" + - "stable-*.*" + schedule: + # Every day at 3:15 AM UTC + - cron: '15 3 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + workspaces: + env: + GAP_VERSION: "4.12.2" + name: "GAP 4.12.2 / ubuntu / 64-bit" + runs-on: ubuntu-latest + container: + image: jamesdbmitchell/gap-docker-minimal:version-4.12.2 + options: --user root + volumes: + - ${{ github.workspace }}:/home/gap/inst/gap-4.12.2/pkg/Semigroups + steps: + - name: "Checkout the Semigroups GAP package" + + uses: actions/checkout@v3 + - name: "Install git + autotools" + run: | + sudo apt-get --yes update + sudo apt-get install git --yes + sudo apt-get install pkg-config m4 libtool automake autoconf --yes + sudo apt-get install libtool-bin --yes + - name: "Setup ccache" + uses: Chocobo1/setup-ccache-action@v1 + with: + update_packager_index: false + override_cache_key: ${{ runner.os }}-v4.12.2-64-${{ github.ref }} + override_cache_key_fallback: ${{ runner.os }}-v4.12.2-64 + - name: "Build the Semigroups GAP package" + run: | + cd /home/gap/inst/gap-4.12.2/pkg/Semigroups + ./prerequisites.sh + ./autogen.sh + ./configure --disable-hpcombi + make -j4 + - name: "Install Semigroups GAP package dependencies" + run: | + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"autodoc\", false));" | gap -A -T --quitonbteak + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"datastructures\", false));" | gap -A -T --quitonbteak + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"digraphs\", false));" | gap -A -T --quitonbteak + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"genss\", false));" | gap -A -T --quitonbteak + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"images\", false));" | gap -A -T --quitonbteak + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"orb\", false) and CompilePackage(\"orb\"));" | gap -A -T --quitonbteak + - name: "Run tst/workspaces/save.g" + run: | + cd /home/gap/inst/gap-4.12.2/pkg/Semigroups + gap -A -T --quitonbreak tst/workspaces/save.g + - name: "Run tst/workspaces/load.g" + run: | + cd /home/gap/inst/gap-4.12.2/pkg/Semigroups + gap -A -T --quitonbreak -L tst/workspaces/test-output.w tst/workspaces/load.g diff --git a/.gitignore b/.gitignore index 5c50d1d01..fbd4b460f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /libsemigroups/ /src/pkgconfig.h.in /src/semigroups-config.hpp +test-output.w diff --git a/ci/run-tests.sh b/ci/run-tests.sh deleted file mode 100755 index 395f191bd..000000000 --- a/ci/run-tests.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash -# -# This file is no longer used by the ci of the Semigroups package but it is -# used by the libsemigroups ci, so don't delete it until that it is not the -# case. - -# If a command fails, exit this script with an error code -set -e -set -o pipefail - -if [ -z "$GAP_HOME" ]; then - echo -e "\nError, the environment variable \"GAP_HOME\" must be set" - exit 1 -elif [ "$ABI" != "32" ] && [ "$ABI" != "64" ]; then - echo -e "\nError, the environment variable \"ABI\" must be set to \"32\" or \"64\", found \"$ABI\"" - exit 1 -fi - -touch $GAP_HOME/testlog.txt -TESTLOG="$GAP_HOME/testlog.txt" -GAPSH="$GAP_HOME/bin/gap.sh" -SEMI_DIR="$GAP_HOME/pkg/semigroups" - -# Temporary workaround because of GAP being weird with memory -if [ "$ABI" == "32" ]; then - MEM=1g -elif [ "$ABI" == "64" ]; then - MEM=2g -fi - -cd $SEMI_DIR/tst/workspaces -echo -e "\nRunning SaveWorkspace tests..." -echo "LoadPackage(\"semigroups\"); SemigroupsTestInstall(); Test(\"save-workspace.tst\"); quit; quit; quit;" | - $GAPSH -A -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - -echo -e "\nRunning LoadWorkspace tests..." -echo "Test(\"load-workspace.tst\"); SemigroupsTestInstall(); quit; quit; quit;" | $GAPSH -L test-output.w -A -x 80 -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - -echo -e "\nRunning Semigroups package standard tests and manual examples..." -echo "LoadPackage(\"semigroups\"); SemigroupsMakeDoc(); SemigroupsTestStandard(); SEMIGROUPS.TestManualExamples();" | - $GAPSH -A -x 80 -m 768m -o $MEM -T 2>&1 | tee -a $TESTLOG - -# Run GAP tests, but only in 64-bit, since they're far too slow in 32-bit -if [ "$ABI" == "64" ]; then - echo -e "\nRunning GAP's testinstall tests with Semigroups loaded..." - # Delete some problematic tests - rm $GAP_HOME/tst/testinstall/strings.tst - rm -f $GAP_HOME/tst/testinstall/stringobj.tst - echo "LoadPackage(\"semigroups\"); Read(\"$GAP_HOME/tst/testinstall.g\");" | - $GAPSH -A -x 80 -m 100m -o 1g -K 2g -T 2>&1 | tee -a $TESTLOG - - # Run GAP testbugfix with Semigroups loaded; this only works with GAP master - if [ "$GAP_VERSION" == "master" ]; then - echo -e "\nRunning GAP's testbugfix tests with Semigroups loaded..." - # Delete some problematic or very long-running tests - rm $GAP_HOME/tst/testbugfix/2016-03-03-t00332.tst - rm $GAP_HOME/tst/testbugfix/2018-05-24-IntermediateSubgroups.tst - rm $GAP_HOME/tst/testbugfix/2018-09-13-MTC.tst - rm $GAP_HOME/tst/testbugfix/2018-12-06-GroupWithGenerators.tst - echo "LoadPackage(\"semigroups\"); Read(\"$GAP_HOME/tst/testbugfix.g\");" | - $GAPSH -A -x 80 -m 100m -o 1g -K 2g -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/tst/workspaces/load-workspace.tst b/tst/workspaces/load-workspace.tst index 361d0c57d..ff07e6ca4 100644 --- a/tst/workspaces/load-workspace.tst +++ b/tst/workspaces/load-workspace.tst @@ -14,9 +14,9 @@ ## ############################################################################# -# Set up testing environment +# DO NOT USE LOCAL VARIABLES @local in this file! -#@local D, DD, id, idd, xx +# Set up testing environment gap> START_TEST("Semigroups package: workspaces/load-workspace.tst"); gap> SEMIGROUPS.StartTest(); @@ -136,6 +136,7 @@ gap> AsDigraph(b); gap> CanonicalBlocks(b); -# +# No point unbinding local variables, since this will only ever be run in a +# workspace gap> SEMIGROUPS.StopTest(); gap> STOP_TEST("Semigroups package: workspaces/load-workspace.tst"); diff --git a/tst/workspaces/load.g b/tst/workspaces/load.g new file mode 100644 index 000000000..dcb8877c4 --- /dev/null +++ b/tst/workspaces/load.g @@ -0,0 +1,11 @@ +############################################################################# +## +#W load.g +#Y Copyright (C) 2023 James D Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## + +QuitGap(Test("tst/workspaces/load-workspace.tst") and SemigroupsTestInstall()); diff --git a/tst/workspaces/save-workspace.tst b/tst/workspaces/save-workspace.tst index 64bed964c..7c11dfad8 100644 --- a/tst/workspaces/save-workspace.tst +++ b/tst/workspaces/save-workspace.tst @@ -14,9 +14,10 @@ ## ############################################################################# +# DO NOT USE LOCAL VARIABLES @local in this file! + # Set up testing environment -#@local D, DD, S, T, U, b, cong, id, idd, x, xx, y gap> START_TEST("Semigroups package: workspaces/save-workspace.tst"); gap> SetInfoLevel(InfoDebug, 0); gap> LoadPackage("semigroups", false);; @@ -146,6 +147,20 @@ gap> SaveWorkspace(Concatenation(SEMIGROUPS.PackageDir, > "/tst/workspaces/test-output.w")); true +# Unbind local variables, auto-generated by etc/tst-unbind-local-vars.py +gap> Unbind(D); +gap> Unbind(DD); +gap> Unbind(S); +gap> Unbind(T); +gap> Unbind(U); +gap> Unbind(b); +gap> Unbind(cong); +gap> Unbind(id); +gap> Unbind(idd); +gap> Unbind(x); +gap> Unbind(xx); +gap> Unbind(y); + # gap> SEMIGROUPS.StopTest(); gap> STOP_TEST("Semigroups package: workspaces/save-workspace.tst"); diff --git a/tst/workspaces/save.g b/tst/workspaces/save.g new file mode 100644 index 000000000..ab084dac6 --- /dev/null +++ b/tst/workspaces/save.g @@ -0,0 +1,14 @@ +############################################################################# +## +#W save.g +#Y Copyright (C) 2023 James D Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## + +SetInfoLevel(InfoPackageLoading, 4); +LoadPackage("semigroups", false); +SetInfoLevel(InfoPackageLoading, 0); +QuitGap(SemigroupsTestInstall() and Test("tst/workspaces/save-workspace.tst"));