Skip to content

Commit

Permalink
Merge pull request #150 from gmdsi/feat_ghactions
Browse files Browse the repository at this point in the history
Feat ghactions
  • Loading branch information
rhugman authored Oct 15, 2024
2 parents 47aff10 + 46e8553 commit f413b80
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,30 @@ jobs:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.9"]
python-version: ["3.11"]
test-path: [
"nb_tests.py"
]

name: ${{ matrix.os }}-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
# Setup conda env
- name: Install Conda environment using micromamba
uses: mamba-org/setup-micromamba@v1
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: gmdsitut
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ./environment.yml
environment-name: pyemu
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}

#- name: Set cache date
# run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Set cache environment variables
shell: bash -l {0}
Expand All @@ -50,22 +53,17 @@ jobs:
CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)")
echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV
# - uses: actions/cache@v2
# with:
# path: ${{ matrix.prefix }}
# key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# id: cache
# make the cache
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ env.CONDA_PREFIX }}
key: ${{ matrix.os }}-${{matrix.python-version}}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

# update the cache if ncessary
- name: Update environment
run: mamba env update -n gmdsitut -f environment.yml
run: micromamba create --name gmdsitut --file environment.yml
if: steps.cache.outputs.cache-hit != 'true'

# add exes to path so that they run in non-win OSs
Expand Down

0 comments on commit f413b80

Please sign in to comment.