separate testing and coverage #123
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: Testing and Coverage | |
on: [ push ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
max-parallel: 6 | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu", "macos" ] | |
python-version: [ "3.10", "3.11", "3.12" ] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Setup env | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
mamba-version: '*' | |
use-mamba: true | |
channels: conda-forge, defaults, bioconda | |
channel-priority: true | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install conda dependencies | |
run: mamba install -c bioconda -y mafft | |
- name: Install self with pip | |
run: pip install . | |
- name: Install test dependencies | |
run: mamba install -c conda-forge -y pytest pytest-cov coveralls | |
- name: Run tests | |
run: > | |
pytest | |
--cov=lXtractor | |
--cov-branch | |
--cov-report=xml # Changed to XML format for interoperability | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report-${{ matrix.python-version }} | |
path: coverage-report-${{ matrix.python-version }}.xml | |
publish-coverage: | |
name: Coverage | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Download coverage data | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-report-3.10 | |
path: coverage-report-3.10.xml | |
- name: Publish Coverage | |
run: coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |