diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml new file mode 100644 index 000000000..b7fc95b4e --- /dev/null +++ b/.github/workflows/downstream.yml @@ -0,0 +1,100 @@ +name: "Downstream" +on: + workflow_dispatch: + pull_request: + push: + branches: + - "main" + - "stable-*.*" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +inputs: + GAP_VERSION : + description: 'the version of GAP required' + required: false + type: string + default: '4.12.2' + GAP_SEMIGROUPS_REPO: + description: 'the repo to use for the Semigroups GAP package' + required: false + type: string + default: 'semigroups' + GAP_SEMIGROUPS_BRANCH: + description: 'the branch to use for the Semigroups GAP package' + required: false + type: string + default: 'stable-5.3' + +jobs: + GAP: + env: + GAP_VERSION: ${{ inputs.GAP_VERSION }} + GAP_SEMIGROUPS_REPO: ${{ inputs.GAP_SEMIGROUPS_REPO }} + GAP_SEMIGROUPS_BRANCH: ${{ inputs.GAP_SEMIGROUPS_BRANCH }} + GAP: "gap -A -T --quiteonbreak" + name: "GAP ${{ inputs.GAP_VERSION }} / Semigroups (${{ inputs.GAP_SEMIGROUPS_REPO }}) / ${{ inputs.GAP_SEMIGROUPS_BRANCH }} / ubuntu / 64-bit" + runs-on: ubuntu-latest + container: + image: jamesdbmitchell/gap-docker-minimal:version-${{ inputs.GAP_VERSION }} + options: --user root + volumes: + - ${{ github.workspace }}:/home/libsemigroups + steps: + - name: "Checkout libsemigroups" + 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 }}-v${{ inputs.GAP_VERSION }}-64-${{ github.ref }} + override_cache_key_fallback: ${{ runner.os }}-v${{ inputs.GAP_VERSION }}-64 + - name: "Clone the Semigroups GAP package" + run: | + rm -rf $HOME/inst/gap-$GAP_VERSION/pkg/semigroups-*.*.* + cd $HOME/inst/gap-$GAP_VERSION/pkg + git clone -b $GAP_SEMIGROUPS_BRANCH --depth=1 https://github.com/$GAP_SEMIGROUPS_REPO/Semigroups.git Semigroups + cd Semigroups + mv /home/libsemigroups . + - name: "Build the Semigroups GAP package" + run: | + cd $HOME/inst/gap-$GAP_VERSION/pkg/Semigroups + if [ -x libsemigroups/etc/version-number.sh ] && [ ! -f libsemigroups/.VERSION ]; then + cd libsemigroups + etc/version-number.sh > .TMP_VERSION + mv .TMP_VERSION .VERSION + cd .. + fi + ./prerequisites.sh + ./autogen.sh + ./configure --disable-hpcombi + make -j4 + - name: "Install Semigroups GAP package dependencies" + run: | + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"autodoc\", false));" | $GAP + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"datastructures\", false));" | $GAP + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"digraphs\", false));" | $GAP + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"genss\", false));" | $GAP + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"images\", false));" | $GAP + echo "LoadPackage(\"PackageManager\"); QuitGap(InstallPackage(\"orb\", false) and CompilePackage(\"orb\"));" | $GAP + - name: "Run Semigroups GAP package workspace tests" + run: | + cd /home/gap/inst/gap-$GAP_VERSION/pkg/Semigroups + $GAP tst/workspaces/save.g + - name: "Run Semigroups GAP package standard tests" + cd /home/gap/inst/gap-${{ inputs.GAP_VERSION }}/pkg/Semigroups + $GAP tst/teststandard.g + - name: "Run GAP testinstall" + $GAP ci/run-gap-testinstall.g + - name: "Run GAP teststandard" + $GAP ci/run-gap-teststandard.g + - name: "Run GAP testbugfix" + $GAP ci/run-gap-testbugfix.g diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b8a51aa6a..fc009f4d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,11 +14,6 @@ pool: vmImage: 'ubuntu-latest' jobs: -- job: GAP - steps: - - script: ci/launch-gap-docker-container.sh - displayName: 'Running the Semigroups package for GAP tests in docker container. . .' - - job: quick steps: - bash: | diff --git a/ci/launch-gap-docker-container.sh b/ci/launch-gap-docker-container.sh deleted file mode 100755 index 46a43c9a3..000000000 --- a/ci/launch-gap-docker-container.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -e - -CONTAINER_NAME="jamesdbmitchell/gap-docker-minimal:version-4.12.1" - -# Pull the docker container -docker pull "$CONTAINER_NAME" - -# Start the docker container detached -ID=$(docker run --rm -i -d "$CONTAINER_NAME") - -# Copy the libsemigroups directory into the container -docker cp . "$ID:/home/gap/libsemigroups" - -# Run the ci/docker-gap.sh script in the running container -docker exec -i "$ID" libsemigroups/ci/run-gap-tests-in-docker-container.sh ; exit - -# Attach to the container -docker attach "$ID" diff --git a/ci/run-gap-tests-in-docker-container.sh b/ci/run-gap-tests-in-docker-container.sh deleted file mode 100755 index e6db39000..000000000 --- a/ci/run-gap-tests-in-docker-container.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -e - -sudo apt-get --yes update - -sudo apt-get install git --yes -sudo apt-get install libtool-bin --yes - -# Next commands executed in the container... -GAP_SEMIGROUPS_BRANCH="stable-5.2" -GAP_SEMIGROUPS_REPO="semigroups" -GAP_VERSION=$(ls inst) -GAP_SH="$HOME/inst/$GAP_VERSION/bin/gap.sh" - -sudo chown 1000:1000 -R libsemigroups/ -if [ -x libsemigroups/etc/version-number.sh ] && [ ! -f libsemigroups/.VERSION ]; then - cd libsemigroups - etc/version-number.sh > .TMP_VERSION - mv .TMP_VERSION .VERSION - cd .. -fi - -# Remove packaged GAP version of Semigroups package -rm -rf $HOME/inst/$GAP_VERSION/pkg/semigroups-*.*.* - -# Clone Semigroups -cd $HOME/inst/$GAP_VERSION/pkg/ - -git clone -b $GAP_SEMIGROUPS_BRANCH --depth=1 https://github.com/$GAP_SEMIGROUPS_REPO/Semigroups.git semigroups -cd semigroups - -# Move the libsemigroups to the correct location -mv $HOME/libsemigroups . -./autogen.sh -./configure --disable-hpcombi -make -j4 - -cd .. -git clone -b master --depth=1 https://github.com/gap-packages/PackageManager.git - -INSTALL_PKGS="if not InstallPackage(\"https://digraphs.github.io/Digraphs/PackageInfo.g\", false) then QuitGap(1); fi;" -INSTALL_PKGS+="if not InstallPackage(\"io\", false) then QuitGap(1); fi;" -INSTALL_PKGS+="if not (InstallPackage(\"orb\", false) and CompilePackage(\"orb\")) then QuitGap(1); fi;" -INSTALL_PKGS+="if not InstallPackage(\"genss\", false) then QuitGap(1); fi;" -INSTALL_PKGS+="if not InstallPackage(\"images\", false) then QuitGap(1); fi;" -INSTALL_PKGS+="if not InstallPackage(\"autodoc\", false) then QuitGap(1); fi;" - -echo "LoadPackage(\"PackageManager\"); InstallPackage(\"PackageManager\", false); $INSTALL_PKGS QUIT;" | $GAP_SH -A -T || exit 1 -cd $HOME/inst/$GAP_VERSION/pkg/semigroups - -export ABI="64" -# Run the tests defined in Semigroups -ci/run-tests.sh