Tests #1424
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- "master" | |
- "*-ci" | |
pull_request: | |
schedule: | |
- cron: "0 4 * * *" # after gap-docker(-master) is rebuilt | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
image: ["ghcr.io/homalg-project/gap-docker:latest", "ghcr.io/homalg-project/gap-docker-master:latest"] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
# keep workflow active even if repository has no activity for 60 days (do not execute for pull requests) | |
- run: '[ "$GITHUB_EVENT_NAME" = "pull_request" ] || curl --fail -X PUT -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/Tests.yml/enable' | |
- uses: actions/checkout@v1 | |
- run: mkdir -p /home/gap/.gap/pkg/ | |
- run: sudo cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ | |
- run: sudo chown -R gap:gap /home/gap/.gap/pkg/ | |
- run: | | |
export HOME="/home/gap" | |
cd /home/gap/.gap/pkg/ | |
cp ./ArangoDBInterface/ci_gaprc /home/gap/.gap/gaprc | |
git clone --depth 1 https://github.com/gap-packages/AutoDoc.git | |
git clone --depth 1 https://github.com/homalg-project/homalg_project.git | |
# set SOURCE_DATE_EPOCH for reproducible PDFs | |
export SOURCE_DATE_EPOCH=0 | |
# build documentation of packages which we might want to reference, keep this in sync with `release-gap-package` | |
[ -d "CAP_project/CAP" ] && make -C "CAP_project/CAP" doc | |
[ -d "CAP_project/CompilerForCAP" ] && make -C "CAP_project/CompilerForCAP" doc | |
[ -d "CAP_project/FreydCategoriesForCAP" ] && make -C "CAP_project/FreydCategoriesForCAP" doc | |
[ -d "CAP_project/MonoidalCategories" ] && make -C "CAP_project/MonoidalCategories" doc | |
[ -d "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" ] && make -C "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" doc | |
[ -d "homalg_project/homalg" ] && make -C "homalg_project/homalg" doc | |
[ -d "homalg_project/Modules" ] && make -C "homalg_project/Modules" doc | |
[ -d "Toposes" ] && make -C "Toposes" doc | |
TERM=dumb make -C ArangoDBInterface -j $(nproc) --output-sync doc | |
git config --global user.name "Bot" | |
git config --global user.email "empty" | |
cd ArangoDBInterface | |
CUR_SHA=$(git rev-parse --verify HEAD) | |
if [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker:latest" ] && [ "$CUR_SHA" = "$(git rev-parse origin/master)" ] && [ $(dirname "$GITHUB_REPOSITORY") = "homalg-project" ]; then \ | |
git worktree add gh-pages/ gh-pages || (echo "There was an error. Make sure there is a branch named 'gh-pages'. See https://github.com/homalg-project/PackageJanitor#error-there-was-an-error-make-sure-there-is-a-branch-named-gh-pages"; exit 1); \ | |
git checkout master; \ | |
LANG=C.UTF-8 ./make_dist.sh --token "${{ secrets.GITHUB_TOKEN }}"; \ | |
else \ | |
echo "Not making a release."; \ | |
fi |