Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ef82032
Update action.yml
stertooy May 3, 2025
b428ed7
Update CI.yml
stertooy May 3, 2025
9fc5b44
Update README.md
stertooy May 3, 2025
140600b
Make installing GAP on MacOS more robust, misc cleanup
stertooy May 8, 2025
000cdcf
Merge branch 'master' into towards-v3
stertooy Aug 27, 2025
cba8d34
Update setup-cygwin action to v2
stertooy Aug 28, 2025
1845af4
Remove need for token input
stertooy Aug 29, 2025
4bd8f31
Add GAP version 4.15.0-beta1 to CII
stertooy Aug 29, 2025
5ef4bdb
Add info on v2 and v3 differences to README.md
stertooy Aug 29, 2025
f3d3933
Remove token input from CI
stertooy Aug 29, 2025
431a4f4
Add example workflows to README.md
stertooy Aug 29, 2025
8455fc0
Apply suggestions from code review
stertooy Aug 31, 2025
cf3993e
Explain gap-version input options more clearly.
stertooy Aug 31, 2025
fdc0bbc
typo in README.md
stertooy Aug 31, 2025
bfed76f
Update README.md
stertooy Aug 31, 2025
ad215ac
Apply suggestions from code review
stertooy Aug 31, 2025
61b93c5
Fix name of branches in README
stertooy Aug 31, 2025
1a51760
Add default command line options to gap executable (#4)
stertooy Aug 31, 2025
b921309
V3 to v3 in README title
stertooy Aug 31, 2025
04a7c8d
Move --quitonbreak from executable 'gap' to variable 'GAP'
stertooy Sep 1, 2025
2e8311f
Update CI to check for GAP variable
stertooy Sep 1, 2025
daf99fb
Add information on cloning packages in README.md
stertooy Sep 1, 2025
e370024
Remove gap-pkgs-to-build from action.yml
stertooy Sep 1, 2025
fb829a6
Update README to reflect removal of gap-pkgs-to-build
stertooy Sep 1, 2025
1dc0aec
Also remove gap-pkgs-to-build from inputs list in README.md
stertooy Sep 1, 2025
3fc48bf
Don't try to install readline on macOS, already installed
stertooy Sep 1, 2025
dbb1141
Don't test stable-4.12 on macOS, causes unpredictable errors
stertooy Sep 1, 2025
4da4e28
Document in README that the oldest available release is v4.10.0
stertooy Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 49 additions & 37 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,65 @@
name: CI

# Trigger the workflow on push or pull request
on:
push:
branches:
- master
- cygwin*
pull_request:

env:
CHERE_INVOKING: 1
workflow_call:
workflow_dispatch:

jobs:
test:
name: ${{ matrix.gap-branch }} ${{ matrix.ABI }} - Packages ${{ matrix.GAP_PKGS_TO_BUILD }} - HPCGAP ${{ matrix.HPCGAP }} - ${{ matrix.os }}
name: ${{ matrix.gap-version }} on ${{ matrix.os }} with ${{ matrix.configflags }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
gap-branch:
- master
ABI: ['']
GAP_PKGS_TO_BUILD:
- ''
- 'default'
HPCGAP: ['no']
include:
- os: ubuntu-latest
gap-branch: master
GAP_PKGS_TO_BUILD: ''
HPCGAP: yes
- os: ubuntu-latest
gap-branch: master
ABI: 32
GAP_PKGS_TO_BUILD: 'default'
HPCGAP: no
os: [ubuntu-latest, macos-latest, windows-latest]
gap-version:
- v4.10
- v4.11.1
- stable-4.12
- v4.13.0-alpha2
- 4.15.0-beta1
- 4
- latest
- default
- v4.16dev
configflags: ['', '--with-gmp=builtin']
exclude:
- os: windows-latest
configflags: '--with-gmp=builtin'
- os: macos-latest
gap-version: stable-4.12
- os: macos-latest
gap-version: v4.10
- os: macos-latest
gap-branch: master
GAP_PKGS_TO_BUILD: ''
HPCGAP: no
gap-version: v4.11.1
configflags: '--with-gmp=builtin'

steps:
- uses: actions/checkout@v5
- if: ${{ matrix.os == 'windows-latest' }}
uses: gap-actions/setup-cygwin@v1
- uses: ./
- name: "Checkout"
uses: actions/checkout@v5

- name: "Setup Cygwin"
if: ${{ matrix.os == 'windows-latest' }}
uses: gap-actions/setup-cygwin@v2

- name: "Setup GAP"
uses: ./
with:
GAPBRANCH: ${{ matrix.gap-branch }}
ABI: ${{ matrix.ABI }}
GAP_PKGS_TO_BUILD: ${{ matrix.GAP_PKGS_TO_BUILD }}
HPCGAP: ${{ matrix.HPCGAP }}
gap-version: ${{ matrix.gap-version }}
configflags: ${{ matrix.configflags }}

- name: "Check if GAP can run"
shell: bash
run: |
gap -A <<GAPINPUT
quit;
GAPINPUT

- name: "Check ENV for GAPROOT and GAP variables"
shell: bash
run: |
if [[ -z "$GAPROOT" || -z "$GAP" ]] ; then
exit 1
fi
137 changes: 113 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,138 @@
# setup-gap V2
# setup-gap v3

This GitHub action downloads and prepares an instance of GAP.
It is intended to be used by the Continuous Integration (CI) action of a GAP
package, that is by an action which runs a package's test suite.

## Supported OSes

This action can be run on macOS and Ubuntu.
This action can be run on macOS, Ubuntu and Windows (when preceded by the `setup-cygwin` action).


## Usage

The action `setup-gap` has to be called by the workflow of a GAP
package.
By default it
- downloads and compiles the master branch of GAP,
- downloads the packages distributed with GAP, and
- compiles the packages `io` and `profiling`
- downloads and compiles the latest release of GAP, and
- compiles the packages `io`, `json` and `profiling`

Its behaviour can be customized via the inputs below.

### Inputs

All of the following inputs are optional.

- `GAP_PKGS_TO_CLONE`:
- A space-separated list of the GAP packages to clone.
- `gap-version`:
- The gap version or branch to build. You may specify "latest" for the latest release, or "default" for the default branch.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your examples it seems one can also specify v4.11.1 (so tags?) or 4 and v4.10 (not tags). Could this be explained please?

Also "default branch" is not clear --presumably this means "GAP development version built from the default branch of the GAP repository"

I guess this hints at a translation key for people upgrading: "master" should become "default" and "stable-4.X" becomes "4.X" (or it stays, if branch names are supported? But better to suggest "4.X")

Copy link
Contributor Author

@stertooy stertooy Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried explaining this in a bit more detail now. Let me know if there's anything still unclear.

EDIT: just realised I explained it in the Changes section, not in the inputs section. I added a line referring to the Changes section, but I'm not sure this is very user-friendly :/

see "Changes to inputs" under "What's new in v3" for more details.
- default: `latest`
- `repository`
- The GitHub repository from which to clone GAP.
- default: `'gap-system/gap'`
- `configflags`:
- Arguments to pass to the GAP configure script.
- default: `''`
- example: `'io autodoc'`
- `GAP_PKGS_TO_BUILD`:
- A space-separated list of the GAP packages to build. Must include
`io` and `profiling`.
- default: `'io profiling'`
- `GAPBRANCH`:
- The gap branch to clone.
- default: `master`
- `HPCGAP`:
- Build HPC-GAP if set to `yes`.
- default: `no`
- `ABI`:
- Set to `32` to use 32bit build flags for the package
- default: `''`
- `GAP_BOOTSTRAP`
- Which packages to build GAP with (options: full or minimal)
- default: `'full'`

### What's new in v3
Version v3 contains many changes compared to version v2. When replacing `setup-gap@v2` by `setup-gap@v3` in an existing workflow,
you will have to change the inputs accordingly. We also recommend replacing branches by releases, e.g. `stable-4.14` by `4.14`.

#### Changes to inputs:
- The `GAPBRANCH` input has been replaced by `gap-version`, which accepts the following input types:
- `latest`: this will use the latest release of GAP. This will **not** point to the latest pre-release if it is more recent
than the latest release.
- version numbers: e.g. `v4.14.0`, `v4.15.0-beta1`, etc. The leading `v` is optional, the oldest available release is `v4.10.0`.
- incomplete version numbers: e.g. `v4`, `v4.10`, etc. These will be expanded to the most recent release starting with the incomplete
version number, e.g. `v4.10` is equivalent to `v4.10.2`. This will **not** expand to pre-releases, and again the leading `v` is
optional.
- branch and tag names: e.g. `master`, `stable-v4.14`, etc. This will use the GAP version built from the corresponding branch or tag.
NB: the inputs `master`, `main` and `default` will always point at the "default branch" of the repository, i.e. the branch you are
presented with when navigating to `github.com/<owner>/<repo>`.
- The inputs `GAP_PKGS_TO_CLONE` and `GAP_PKGS_TO_BUILD` have been removed. This should now be done by the user in a separate step in
the workflow, e.g. by using `git clone` or the [PackageManager](https://gap-packages.github.io/PackageManager/) package. See the
Examples section below.
- The input `GAP_PKGS_TO_BUILD` has been renamed to `gap-pkgs-to-build`. It can only be used to build packages distributed with GAP.
In addition to `IO` and `profiling`, the package `json` is now also built by default.
- The inputs `HPCGAP` and `ABI` have been removed, and support for both HPC-GAP and 32-bit builds has been removed.
- The (previously undocumented) input `CONFIGFLAGS` has been renamed to `configflags`.
- The input `GAP_BOOTSTRAP` has been removed. GAP will always come with all distributed packages.
- An input `repository` has been added, which allows building a version of GAP hosted on a repository different from `gap-system/gap`.

#### Changes to functionality:
- There is no longer a separate branch for running this action on Windows. This action should work on Windows, assuming it is
preceded by version v2 or later of [setup-cygwin](https://github.com/gap-actions/setup-gap).
- The installation location of GAP is stored in the environment variable `GAPROOT`, which can be used in subsequent steps in the workflow.
- The GAP executable is added to `PATH`, thus GAP can now always be started by calling `gap`.

### Examples

The following is a minimal example to run this action.

```yaml
name: CI

on:
push:
pull_request:

jobs:
# The CI test job
test:
name: CI test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: gap-actions/setup-gap@v3
# ... additional steps using GAP will usually follow here
```

A more extensive example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I started writing the below text last night, and adding it now so it is not completely lost, even though it may be out of date)

I think it would be good if this or another example showed how to replace GAP_PKGS_TO_CLONE. There are of course multiple ways.

A simple example might do

      - run: |
         cd $GAPROOT/pkg
         rm -rf cvec
         git clone https://github.com/gap-packages/cvec

It is actually weird that we have to delete an existing copy of the package. Perhaps better to install into a separate root directory, e.g. ~/.gap/pkg/, or even /tmp/gaproot/pkg (which several other GitHub actions already use for a symlink to the package being tested... perhaps we should formalize that here.. Indeed we could even ensure this is a GAP root here without fiddling with package dirs... E.g. by providing a ~/.gap/gap.ini file which calls ExtendRootDirectories).

Alternatively one could suggest using PackageManager (which also compiles),
though for some stuff one really needs the clone, so perhaps both

      - run: |
         gap -c 'LoadPackage("PackageManager"); InstallPackage("cvec"); QUIT;'

and also

      - run: |
         gap -c 'LoadPackage("PackageManager"); InstallPackage("https://github.com/gap-packages/cvec"); QUIT;'

could be useful examples ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this as part of the second example now: one step using git clone in $HOME/.gap/pkg, a second using PackageManager.


```yaml
name: CI

on:
push:
pull_request:

jobs:
# The CI test job
test:
name: CI test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
gap-version:
- latest
- v4.15.0-beta1
- master

steps:
- uses: gap-actions/setup-cygwin@v2
if: ${{ matrix.os == 'windows-latest' }}
- uses: actions/checkout@v5
- uses: gap-actions/setup-gap@v3
with:
gap-version: ${{ matrix.gap-version }}
- shell: bash
run: |
# Install package via 'git clone'
cd $HOME/.gap/pkg
git clone https://github.com/gap-packages/io
cd io
sh autogen.sh
./configure --with-gaproot=$GAPROOT
make -j4
- shell: bash
run: |
# Install packages via PackageManager
gap -c 'LoadPackage("PackageManager"); InstallPackage("https://github.com/gap-packages/orb"); QUIT;'
gap -c 'LoadPackage("PackageManager"); InstallPackage("cvec"); QUIT;'
```

## Contact
Please submit bug reports, suggestions for improvements and patches via
Expand Down
Loading
Loading