Add bootstrap option and limit the bs to accelerate pytest #1
This file contains hidden or 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: CI/build and test | |
on: | |
push: | |
branches: ["main", "dev"] | |
paths: ["**.py", "requirements.txt"] | |
pull_request: | |
branches: ["main", "dev"] | |
paths: ["**.py", "requirements.txt"] | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build-muscle: | |
uses: ./.github/workflows/build_muscle.yml | |
build-aster: | |
uses: ./.github/workflows/build_aster.yml | |
build-fasttree: | |
uses: ./.github/workflows/build_fasttree.yml | |
build-raxml: | |
uses: ./.github/workflows/build_raxml.yml | |
build-iqtree: | |
uses: ./.github/workflows/build_iqtree.yml | |
build-and-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
env: | |
OS: Linux | |
needs: | |
[build-muscle, build-aster, build-fasttree, build-raxml, build-iqtree] | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- run: git fetch --tags | |
- name: Cache Python packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest pytest-cov | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with Ruff | |
uses: astral-sh/ruff-action@v3 | |
- name: Install package | |
run: pip install . | |
- name: Cache muscle | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin/muscle | |
key: ${{ runner.os }}-muscle | |
- name: Cache ASTER | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin/astral | |
key: ${{ runner.os }}-ASTER | |
- name: Cache FastTree | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin/FastTree | |
key: ${{ runner.os }}-FastTree | |
- name: Cache RAxML | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin/raxmlHPC-PTHREADS-AVX2 | |
key: ${{ runner.os }}-RAxML | |
- name: Cache IQTree | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin/iqtree2 | |
key: ${{ runner.os }}-IQTree | |
- name: Test with pytest | |
run: | | |
package_name=$(grep '^name = ' pyproject.toml | sed 's/name = "\(.*\)"/\1/' | tr -d '[:space:]') | |
pytest -vv --cov=$package_name --cov-report=xml --runslow | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
flags: ${{ matrix.python }} | |
env_vars: OS | |
files: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |