Skip to content

Commit f6de987

Browse files
committed
Refactor CI workflow to use micromamba for environment setup and streamline installation steps
1 parent be27f60 commit f6de987

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

.github/workflows/run_tests.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Tests
22

33
on: [push]
44

5-
65
env:
76
CONDA_PREFIX: /home/runner/work/microSALT/microSALT/tests
87
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
@@ -14,31 +13,37 @@ jobs:
1413
max-parallel: 5
1514

1615
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python 3.8
19-
uses: actions/setup-python@v3
20-
with:
21-
python-version: '3.8.15'
22-
- name: Create conda/mamba environment using micromamba
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Conda environment using micromamba
2320
uses: mamba-org/setup-micromamba@v1
2421
with:
2522
environment-file: environment.yml
2623
cache-downloads: true
27-
- name: Install microSALT
24+
25+
- name: Activate Conda environment and install microSALT
2826
run: |
29-
mkdir ~/.microSALT && cp configExample.json ~/.microSALT/config.json
30-
GITHUB_BRANCH=${GITHUB_REF##*/}
31-
pip install -r requirements.txt -r requirements-dev.txt
32-
pip install -U .
27+
source ~/.bashrc
28+
micromamba activate microsalt-env
29+
python -m pip install -r requirements.txt -r requirements-dev.txt
30+
python -m pip install -U .
31+
3332
- name: Lint with flake8
3433
run: |
35-
# stop the build if there are Python syntax errors or undefined names
34+
source ~/.bashrc
35+
micromamba activate microsalt-env
3636
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3837
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38+
3939
- name: Test with pytest
4040
run: |
41+
source ~/.bashrc
42+
micromamba activate microsalt-env
4143
pytest --cov=microSALT tests
44+
4245
- name: Run Coveralls
4346
run: |
44-
coveralls
47+
source ~/.bashrc
48+
micromamba activate microsalt-env
49+
coveralls

0 commit comments

Comments
 (0)