-
Notifications
You must be signed in to change notification settings - Fork 7
105 lines (102 loc) · 3.35 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: test
on:
push:
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'
pull_request:
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'
defaults:
run:
shell: bash -l {0}
jobs:
build:
name: build environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/conda_pkgs_dir
/usr/share/miniconda/envs/roman-data-workshop-env
key: conda-${{ runner.os }}-${{ hashFiles('00_install/environment.yml') }}-${{ github.sha }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: roman-data-workshop-env
environment-file: 00_install/environment.yml
use-only-tar-bz2: true
- 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: actions/cache@v3
with:
path: |
~/conda_pkgs_dir
/usr/share/miniconda/envs/roman-data-workshop-env
key: conda-${{ runner.os }}-${{ hashFiles('00_install/environment.yml') }}-${{ github.sha }}
if: steps.data_cache.outputs.cache-hit != 'true'
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: roman-data-workshop-env
environment-file: 00_install/environment.yml
use-only-tar-bz2: true
if: steps.data_cache.outputs.cache-hit != 'true'
- run: python data/download.py
if: steps.data_cache.outputs.cache-hit != 'true'
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
test:
name: run notebooks
needs: [ build, data, crds_contexts ]
runs-on: ubuntu-latest
env:
CRDS_SERVER_URL: https://roman-crds.stsci.edu
CRDS_PATH: /tmp/data/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/conda_pkgs_dir
/usr/share/miniconda/envs/roman-data-workshop-env
key: conda-${{ runner.os }}-${{ hashFiles('00_install/environment.yml') }}-${{ github.sha }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: roman-data-workshop-env
environment-file: 00_install/environment.yml
use-only-tar-bz2: true
- uses: actions/cache@v3
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ needs.crds_contexts.outputs.roman }}
- run: crds sync --contexts ${{ needs.crds_contexts.outputs.roman }}
- 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 .