-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflow for quality checks and testing
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v4 | ||
env: | ||
CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
|
||
- name: Setup Conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
environment-file: environment.yml | ||
|
||
- name: Install Docker | ||
uses: docker-practice/actions-setup-docker@master | ||
|
||
- name: Install Poetry | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: 1.8.5 | ||
|
||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
poetry env info | ||
poetry install | ||
pip list | ||
- name: Run tests | ||
run: | | ||
poetry run pytest -s |