|
2 | 2 | pull_request:
|
3 | 3 | workflow_dispatch:
|
4 | 4 | env:
|
5 |
| - CONDA_TYPE: Mambaforge |
6 |
| - CONDA_VERSION: 23.1.0-1 |
| 5 | + CONDA_IMAGE: condaforge/mambaforge:23.1.0-1 |
7 | 6 | CONDA_PATH: /opt/conda
|
8 |
| - CONDA_CACHEBUST: 1 |
9 |
| - FBF_ENV_CACHEBUST: 1 |
| 7 | + FBF_CACHEBUST: 1 |
10 | 8 | jobs:
|
11 | 9 | test:
|
12 | 10 | name: fbf-test
|
13 | 11 | runs-on: ubuntu-22.04
|
| 12 | + container: |
| 13 | + image: ${{env.CONDA_IMAGE}} |
14 | 14 | steps:
|
15 | 15 | - uses: actions/checkout@v3
|
16 | 16 |
|
17 |
| - - name: restore miniconda cache |
18 |
| - id: restore-miniconda |
19 |
| - uses: actions/cache/restore@v3 |
20 |
| - with: |
21 |
| - path: ${{env.CONDA_PATH}} |
22 |
| - key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} |
23 |
| - |
24 |
| - # I tried and rejected the existing setup-miniconda action, |
25 |
| - # because it wipes out a bunch of files like ~/.profile, |
26 |
| - # ~/.bashrc, ~/.bash_profile in a way that (a) won't interact |
27 |
| - # well with other actions that also need to modify the shell |
28 |
| - # environment, and (b) doesn't play well with caching (you can't |
29 |
| - # cache the deletion of a file). Also this way seems to take |
30 |
| - # about half the time (though that might just be random |
31 |
| - # variation). |
32 |
| - - name: download miniconda |
33 |
| - run: curl -L --no-progress-meter -o miniconda-installer.sh "https://github.com/conda-forge/miniforge/releases/download/${{env.CONDA_VERSION}}/${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-Linux-x86_64.sh" |
34 |
| - if: steps.restore-miniconda.outputs.cache-hit != 'true' |
35 |
| - |
36 |
| - - name: run miniconda installer |
37 |
| - run: bash miniconda-installer.sh -b -p ${{env.CONDA_PATH}} |
38 |
| - if: steps.restore-miniconda.outputs.cache-hit != 'true' |
39 |
| - |
40 |
| - - name: clean up miniconda to reduce cache size |
41 |
| - run: rm miniconda-installer.sh && source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda clean -afy |
42 |
| - if: steps.restore-miniconda.outputs.cache-hit != 'true' |
43 |
| - |
44 |
| - - name: save miniconda cache |
45 |
| - uses: actions/cache/save@v3 |
46 |
| - with: |
47 |
| - path: ${{env.CONDA_PATH}} |
48 |
| - key: miniconda-${{env.CONDA_TYPE}}-${{env.CONDA_VERSION}}-${{env.CONDA_CACHEBUST}} |
49 |
| - if: steps.restore-miniconda.outputs.cache-hit != 'true' |
50 |
| - |
51 | 17 | - name: restore fbfmaproom conda environment cache
|
52 | 18 | id: restore-fbfmaproom-env
|
53 | 19 | uses: actions/cache/restore@v3
|
54 | 20 | with:
|
55 | 21 | path: ${{env.CONDA_PATH}}/envs/fbfmaproom
|
56 |
| - key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} |
| 22 | + key: fbfmaproom-env-${{CONDA_IMAGE}}-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.FBF_CACHEBUST}} |
57 | 23 |
|
58 | 24 | - name: install fbfmaproom dependencies
|
59 |
| - run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && mamba create -n fbfmaproom --file fbfmaproom/conda-linux-64.lock |
| 25 | + run: mamba create -n fbfmaproom --file fbfmaproom/conda-linux-64.lock |
60 | 26 | if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true'
|
61 | 27 |
|
62 | 28 | - name: save fbfmaproom conda environment cache
|
63 | 29 | uses: actions/cache/save@v3
|
64 | 30 | with:
|
65 | 31 | path: ${{env.CONDA_PATH}}/envs/fbfmaproom
|
66 |
| - key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.CONDA_CACHEBUST}}-${{env.FBF_ENV_CACHEBUST}} |
| 32 | + key: fbfmaproom-env-${{ hashFiles('fbfmaproom/conda-linux-64.lock') }}-${{env.FBF_CACHEBUST}} |
67 | 33 | if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true'
|
68 | 34 |
|
69 | 35 | - name: run fbf tests
|
70 |
| - run: source ${{env.CONDA_PATH}}/etc/profile.d/conda.sh && conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py |
| 36 | + run: conda activate fbfmaproom && cd fbfmaproom && CONFIG=fbfmaproom-sample.yaml python -m pytest tests/test_pingrid.py |
0 commit comments