Travis2githubactions #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: read | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
# Set it to default use bash in interactive mode (required for miniconda setup) | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: create environment with mamba | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
mamba-version: "*" | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,bioconda,defaults | |
auto-activate-base: false | |
environment-file: ../environment.yml | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
python setup.py install | |
- name: Test with pytest | |
run: | | |
python -m pytest tests/ |