-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from martin-g/fix-link-gha-workflow
- Loading branch information
Showing
3 changed files
with
160 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: "Caching Env Example" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
push: | ||
branches: | ||
- "master" | ||
schedule: | ||
# Note that cronjobs run on master/main by default | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
caching-example: | ||
name: Caching-Env | ||
|
||
# prevent cronjobs from running on forks | ||
if: | ||
(github.event_name == 'schedule' && github.repository == | ||
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
label: linux-64 | ||
prefix: /usr/share/miniconda3/envs/anaconda-client-env | ||
|
||
- os: macos-latest | ||
label: osx-64 | ||
prefix: /Users/runner/miniconda3/envs/anaconda-client-env | ||
|
||
- os: windows-latest | ||
label: win-64 | ||
prefix: C:\Miniconda3\envs\anaconda-client-env | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
activate-environment: anaconda-client-env | ||
use-mamba: true | ||
|
||
- name: Set cache date | ||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- name: Cache conda env | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ matrix.prefix }} | ||
key: ${{ matrix.label }}-conda-${{ hashFiles('etc/example-environment-caching.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | ||
env: | ||
# Increase this value to reset cache if etc/example-environment.yml has not changed | ||
CACHE_NUMBER: 0 | ||
id: cache | ||
|
||
- name: Update environment | ||
run: mamba env update -n anaconda-client-env -f etc/example-environment-caching.yml | ||
if: steps.cache.outputs.cache-hit != 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,5 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- run: | | ||
npm install | ||
npm check | ||
npm build | ||
npm run check | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters