Skip to content

Commit

Permalink
use artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ssolson committed Jul 10, 2023
1 parent 8b56f42 commit 204662a
Showing 1 changed file with 41 additions and 22 deletions.
63 changes: 41 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ jobs:
pytest mhkit/tests/wave/io/hindcast/test_hindcast.py
pytest mhkit/tests/wave/io/hindcast/test_wind_toolkit.py

- name: Cache data
uses: actions/cache@v2
id: cache-data
# - name: Cache data
# uses: actions/cache@v2
# id: cache-data
# with:
# path: ~/.cache/mhkit
# key: static-data-key

- name: Upload data as artifact
uses: actions/upload-artifact@v2
with:
name: data
path: ~/.cache/mhkit
key: static-data-key

conda-build:
name: conda-${{ matrix.os }}/${{ matrix.python-version }}
Expand Down Expand Up @@ -92,14 +98,18 @@ jobs:
python -m pip install --upgrade pip wheel
pip install coverage pytest coveralls .

- name: Restore cached data
uses: actions/cache@v2
# - name: Restore cached data
# uses: actions/cache@v2
# with:
# path: ~/.cache/mhkit
# key: static-data-key
# restore-keys: |
# data-key-
- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit
# key: data-key-${{ hashFiles('**/*.py') }}
key: static-data-key
restore-keys: |
data-key-

- name: Run pytest
shell: bash -l {0}
Expand Down Expand Up @@ -138,14 +148,19 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Restore cached data
uses: actions/cache@v2
# - name: Restore cached data
# uses: actions/cache@v2
# with:
# path: ~/.cache/mhkit
# key: static-data-key
# restore-keys: |
# data-key-

- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit
# key: data-key-${{ hashFiles('**/*.py') }}
key: static-data-key
restore-keys: |
data-key-

- name: Update and install packages
run: |
Expand Down Expand Up @@ -192,14 +207,18 @@ jobs:
export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config
pip install -e . --no-deps --force-reinstall

- name: Restore cached data
uses: actions/cache@v2
# - name: Restore cached data
# uses: actions/cache@v2
# with:
# path: ~/.cache/mhkit
# key: static-data-key
# restore-keys: |
# data-key-
- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit
# key: data-key-${{ hashFiles('**/*.py') }}
key: static-data-key
restore-keys: |
data-key-

- name: Install MHKiT and run pytest
shell: bash -l {0}
Expand Down

0 comments on commit 204662a

Please sign in to comment.