Tests #70
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
# This is a basic workflow to help you get started with Actions | |
name: Tests | |
# Controls when the action will run. | |
on: | |
push: | |
branches: [ main, devel ] | |
paths: | |
- 'phyluce/**' | |
- 'bin/**' | |
- 'workflows/**' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'phyluce/**' | |
- 'bin/**' | |
- 'workflows/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run-linters: | |
name: Run linters on phyluce | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.6 | |
- name: Install Python dependencies | |
run: pip install black flake8 | |
- name: Run linters | |
uses: wearerequired/lint-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
continue_on_error: false | |
git_email: "[email protected]" | |
auto_fix: true | |
# Enable linters | |
black: true | |
flake8: true | |
build-and-test: | |
needs: run-linters | |
name: Build and test phyluce | |
runs-on: ubuntu-20.04 | |
# If we set the default shell here, it catches the activated conda | |
# and we don't need to keep calling it. | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
# setup cache for conda files | |
- name: Cache conda packages | |
uses: actions/cache@v1 | |
env: | |
# Increase this value to reset cache if | |
# etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{hashFiles('etc/phyluce-testing-environment.yml') }} | |
# we'll use the handy conda incubator miniconda package | |
- name: Set miniconda up | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: true | |
python-version: 3.6 | |
environment-file: etc/phyluce-testing-environment.yml | |
- name: Install phyluce to get config, workflows, and paths correct | |
run: | | |
pip install . | |
- name: Run pytest against phyluce | |
run: | | |
pytest -vv phyluce/ |