Skip to content

Commit 755b9f4

Browse files
committed
Run in container
1 parent c914f22 commit 755b9f4

File tree

1 file changed

+8
-42
lines changed

1 file changed

+8
-42
lines changed

.github/workflows/fbf-test.yaml

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,35 @@ on:
22
pull_request:
33
workflow_dispatch:
44
env:
5-
CONDA_TYPE: Mambaforge
6-
CONDA_VERSION: 23.1.0-1
5+
CONDA_IMAGE: condaforge/mambaforge:23.1.0-1
76
CONDA_PATH: /opt/conda
8-
CONDA_CACHEBUST: 1
9-
FBF_ENV_CACHEBUST: 1
7+
FBF_CACHEBUST: 1
108
jobs:
119
test:
1210
name: fbf-test
1311
runs-on: ubuntu-22.04
12+
container:
13+
image: ${{env.CONDA_IMAGE}}
1414
steps:
1515
- uses: actions/checkout@v3
1616

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-
5117
- name: restore fbfmaproom conda environment cache
5218
id: restore-fbfmaproom-env
5319
uses: actions/cache/restore@v3
5420
with:
5521
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}}
5723

5824
- 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
6026
if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true'
6127

6228
- name: save fbfmaproom conda environment cache
6329
uses: actions/cache/save@v3
6430
with:
6531
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}}
6733
if: steps.restore-fbfmaproom-env.outputs.cache-hit != 'true'
6834

6935
- 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

Comments
 (0)