Skip to content

Commit

Permalink
CI: Cache data separately from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Sep 17, 2024
1 parent d7e10df commit 999beec
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,11 @@ permissions:
contents: read

jobs:
build-linux:
cache-test-data:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
env:
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- name: Git settings (pacify DataLad)
run: |
Expand All @@ -48,8 +43,8 @@ jobs:
python-${{ matrix.python-version }}-
- name: Install DataLad
run: |
$CONDA/bin/conda install -c conda-forge git-annex datalad pip pytest
$CONDA/bin/python -m pip install datalad-osf
$CONDA/bin/conda install -c conda-forge git-annex
python -m pip install datalad datalad-next datalad-osf
- uses: actions/cache@v3
with:
Expand All @@ -62,19 +57,40 @@ jobs:
run: |
export PATH=$CONDA/bin:$PATH
mkdir -p /home/runner/testdata
cd /home/runner/testdata
$CONDA/bin/datalad install https://gin.g-node.org/oesteban/nitransforms-tests
$CONDA/bin/datalad update --merge -d nitransforms-tests/
$CONDA/bin/datalad get -d nitransforms-tests/
datalad install https://gin.g-node.org/oesteban/nitransforms-tests /home/runner/testdata/nitransforms-tests
datalad update --merge -d /home/runner/testdata/nitransforms-tests/
datalad get -J 2-d /home/runner/testdata/nitransforms-tests/
build-linux:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
needs: [cache-test-data]
env:
TEST_DATA_HOME: /home/runner/testdata/nitransforms-tests
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ${{ env.TEST_DATA_HOME }}
key: data-cache-v2
restore-keys: |
data-cache-v2
- uses: actions/checkout@v3
- name: Install minimal dependencies
run: |
$CONDA/bin/pip install .[tests]
pip install .[tests]
- name: Run pytest
run: |
$CONDA/bin/pytest -v --cov nitransforms --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules nitransforms/
pytest -v --cov nitransforms --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules nitransforms/
- name: Submit code coverage
uses: codecov/codecov-action@v3
Expand Down

0 comments on commit 999beec

Please sign in to comment.