diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0bf2158a7e7..c0b214fc8f6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -108,18 +108,30 @@ jobs: -ra . \ -m 'needs_solo_run' + - name: Cache GRASS Sample Dataset + id: cached-data + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + with: + path: sample-data/nc_spm_full_v2alpha2.tar.gz + key: nc_spm_full_v2alpha2.tar.gz + enableCrossOsArchive: true + + - name: Download GRASS Sample Dataset + if: steps.cached-data.outputs.cache-hit != 'true' + run: | + mkdir -p sample-data + curl -L "$SAMPLE_DATA" -o sample-data/nc_spm_full_v2alpha2.tar.gz + env: + SAMPLE_DATA: "https://grass.osgeo.org/sampledata/north_carolina/\ + nc_spm_full_v2alpha2.tar.gz" + - name: Run gunittest tests shell: micromamba-shell {0} - run: | - grass --tmp-project XY --exec \ - g.download.project url=${{ env.SampleData }} path=$HOME - grass --tmp-project XY --exec \ - python3 -m grass.gunittest.main \ - --grassdata $HOME --location nc_spm_full_v2alpha2 --location-type nc \ - --min-success 100 --config .github/workflows/macos_gunittest.cfg + run: .github/workflows/test_thorough.sh --config .github/workflows/macos_gunittest.cfg env: - SampleData: "https://grass.osgeo.org/sampledata/north_carolina/\ + SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/\ nc_spm_full_v2alpha2.tar.gz" + - name: Make HTML test report available if: ${{ !cancelled() }} uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 diff --git a/.github/workflows/test_thorough.sh b/.github/workflows/test_thorough.sh index 6ed7d22078a..57c545133df 100755 --- a/.github/workflows/test_thorough.sh +++ b/.github/workflows/test_thorough.sh @@ -3,8 +3,10 @@ # fail on non-zero return code from a subprocess set -e +SAMPLE_DATA_URL=${SAMPLE_DATA_URL:-"https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz"} + grass --tmp-project XY --exec \ - g.download.project url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME + g.download.project url=$SAMPLE_DATA_URL path=$HOME grass --tmp-project XY --exec \ python3 -m grass.gunittest.main \ diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5f130a00812..0260e8882e2 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -146,8 +146,28 @@ jobs: - name: Test executing of the grass command run: .github/workflows/test_simple.sh + - name: Cache GRASS Sample Dataset + id: cached-data + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + with: + path: sample-data/nc_spm_full_v2alpha2.tar.gz + key: nc_spm_full_v2alpha2.tar.gz + enableCrossOsArchive: true + + - name: Download GRASS Sample Dataset + if: steps.cached-data.outputs.cache-hit != 'true' + run: | + mkdir -p sample-data + curl -L "$SAMPLE_DATA" -o sample-data/nc_spm_full_v2alpha2.tar.gz + env: + SAMPLE_DATA: "https://grass.osgeo.org/sampledata/north_carolina/\ + nc_spm_full_v2alpha2.tar.gz" + - name: Run tests run: .github/workflows/test_thorough.sh --config .gunittest.extra.cfg + env: + SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/\ + nc_spm_full_v2alpha2.tar.gz" - name: Make HTML test report available if: ${{ always() }}