Skip to content

Commit

Permalink
Add CI workflow for quality checks and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cstub committed Jan 13, 2025
1 parent c834583 commit e3d0558
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit e3d0558

Please sign in to comment.