Skip to content

Commit

Permalink
modernized CI workflow
Browse files Browse the repository at this point in the history
- use micromamba instead of mamba
- use separate ci/conda-envs/test_env.yaml for conda env
- use CODECOV_TOKEN for codecov
  • Loading branch information
orbeckst committed Sep 15, 2023
1 parent 05c3625 commit 2ad40f0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -65,57 +69,49 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: setup miniconda (Python ${{ matrix.python-version }})
uses: conda-incubator/setup-miniconda@v2
- name: micromamba environment and package installation (Python ${{ matrix.python-version }})
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,bioconda,defaults
channel-priority: true
show-channel-urls: true

- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
environment-file: ci/conda-envs/test_env.yaml
condarc: |
channels:
- conda-forge
- bioconda
channel_priority: flexible
cache-downloads: true
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Python version ${{ matrix.python-version }}
shell: bash -l {0}
- name: Python version information ${{ matrix.python-version }}
run: |
python -c "import sys; print(sys.version)"
- name: Install package dependencies
shell: bash -l {0}
- name: micromamba environment information
run: |
mamba install six numpy scipy matplotlib-base pandas numkit
micromamba info
micromamba list
- name: Install pytest and plugins
shell: bash -l {0}
run: |
mamba install pytest pytest-pep8 pytest-cov codecov
micromamba install pytest pytest-pep8 pytest-cov codecov
- name: Install GROMACS (${{ matrix.gromacs-version }})
shell: bash -l {0}
run: |
mamba install 'gromacs==${{ matrix.gromacs-version }}' pocl
micromamba install 'gromacs==${{ matrix.gromacs-version }}' pocl
- name: Install package
shell: bash -l {0}
- name: Install package (with no dependencies)
run: |
python -m pip install --no-deps .
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs --cov-report=xml --color=yes ./tests
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
file: ./coverage.xml
fail_ci_if_error: false
12 changes: 12 additions & 0 deletions ci/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: test
channels:
- conda-forge
- bioconda
dependencies:
- python
- six
- numpy
- scipy
- matplotlib-base
- pandas
- numkit

0 comments on commit 2ad40f0

Please sign in to comment.