Skip to content

[CI] replace usage of miniconda with micromamba #122

[CI] replace usage of miniconda with micromamba

[CI] replace usage of miniconda with micromamba #122

Workflow file for this run

name: test
on:
push:
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'
pull_request:
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build:
name: build environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: roman-data-workshop-env
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
- run: python ./00_install/verify_install.py
- run: conda env export > roman-data-workshop-env-${{ github.sha }}.yml
- uses: actions/[email protected]
with:
name: roman-data-workshop-env-${{ github.sha }}.yml
path: roman-data-workshop-env-${{ github.sha }}.yml
data:
name: download data
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: data_cache
with:
path: data/
key: data-${{ hashFiles('data/download.py') }}
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: roman-data-workshop-env
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
if: steps.data_cache.outputs.cache-hit != 'true'
- run: python data/download.py
if: steps.data_cache.outputs.cache-hit != 'true'
test:
name: run notebooks
needs: [ build, data ]
runs-on: ubuntu-latest
env:
CRDS_SERVER_URL: https://roman-crds-test.stsci.edu
CRDS_PATH: ~/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: roman-data-workshop-env
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
- run: echo "name=crds_context::$(crds list --operational-context)" >> $GITHUB_OUTPUT
id: crds_context
- uses: actions/cache@v3
with:
path: ${{ env.CRDS_PATH }}
key: crds-jwst-datamodels-${{ steps.crds_context.outputs.crds_context }}
if: steps.crds_context.outputs.crds_context != ''
- run: crds sync --contexts ${{ steps.crds_context.outputs.crds_context }}
if: steps.crds_context.outputs.crds_context != ''
- uses: actions/cache@v3
with:
path: data/
key: data-${{ hashFiles('data/download.py') }}
- run: python data/download.py
- run: pip install nbcollection
- run: python -m nbcollection execute .