diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e8818fc..7cb8caa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,11 +29,11 @@ jobs: # the order of the checkout actions is important because all contents of # the target folder of the checkout action is removed - name: "Clone the Example package" - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: gap-packages/example - name: "Check out this repository" - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: this-action/ - uses: gap-actions/setup-cygwin@v1 diff --git a/README.md b/README.md index a8d11c6..02b1e91 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: gap-actions/setup-gap@v2 - uses: gap-actions/build-pkg@v1 - uses: gap-actions/run-pkg-tests@v2 diff --git a/action.yml b/action.yml index b236267..781e0eb 100644 --- a/action.yml +++ b/action.yml @@ -4,11 +4,18 @@ 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 env: CHERE_INVOKING: 1 @@ -31,7 +38,11 @@ runs: ln -f -s $PWD /tmp/gaproot/pkg/ # start GAP with custom GAP root, to ensure correct package version is loaded - GAP="$GAPROOT/bin/gap.sh -l /tmp/gaproot; --quitonbreak" + 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 @@ -51,8 +62,13 @@ runs: # Load the package with debug info SetInfoLevel(InfoPackageLoading, PACKAGE_DEBUG); SetPackagePath(info.PackageName, "/tmp/gaproot/pkg/$(basename $PWD)"); - LoadPackage(info.PackageName); + if ${{ inputs.only-needed }} = true then + LoadPackage(info.PackageName : OnlyNeeded); + else + LoadPackage(info.PackageName); + fi; SetInfoLevel(InfoPackageLoading, PACKAGE_ERROR); + Print("Now running tests from ", GAP_TESTFILE, "\n"); if EndsWith(GAP_TESTFILE, ".tst") then QUIT_GAP(Test(GAP_TESTFILE, rec(compareFunction := "uptowhitespace"))); else