Skip to content

Migrate component create to nf test #5341

Migrate component create to nf test

Migrate component create to nf test #5341

Workflow file for this run

name: Python tests
# This workflow is triggered on pushes and PRs to the repository.
# Only run if we changed a Python file
on:
push:
branches:
- dev
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
pull_request:
paths-ignore:
- "docs/**"
- "CHANGELOG.md"
release:
types: [published]
# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
pytest:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
python-version: ["3.8", "3.11"]
runner: ["ubuntu-latest"]
include:
- runner: "ubuntu-20.04"
python-version: "3.8"
steps:
- uses: actions/checkout@v3
name: Check out source-code repository
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip -r requirements-dev.txt
pip install -e .
- name: Downgrade git to the Ubuntu official repository's version
if: ${{ matrix.runner == 'ubuntu-20.04' && matrix.python-version == '3.8' }}
run: |
sudo apt update
sudo apt remove git git-man
sudo add-apt-repository --remove ppa:git-core/ppa
sudo apt install git
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_ENV
- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
with:
version: "latest-everything"
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
- name: Install nf-test
run: |
conda install -c bioconda nf-test
- name: Test with pytest
run: python3 -m pytest tests/ --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core
- uses: codecov/codecov-action@v1
name: Upload code coverage report
with:
if: success()
token: ${{ secrets.CODECOV_TOKEN }}