Skip to content

Commit

Permalink
major CI refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinblampey committed Feb 12, 2024
1 parent 7be0976 commit 7be60ad
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
name: ci
on:
push:
branches: [master]
branches: [master, dev]
tags:
- v*
pull_request:
branches: [master]
branches: [master, dev]

jobs:
deploy-doc:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

build:
needs: [pre-commit]
runs-on: ubuntu-latest
steps:
#----------------------------------------------
Expand All @@ -20,12 +28,18 @@ jobs:
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.10

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
Expand All @@ -35,21 +49,26 @@ jobs:
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --extras "dev cellpose"
run: poetry install --extras "dev cellpose" --no-interaction

#----------------------------------------------
# run test suite
# perform tasks
#----------------------------------------------
- name: Tests
run: poetry run pytest

- name: Deploy doc
if: contains(github.ref, 'tags')
run: poetry run mkdocs gh-deploy --force

publish:
needs: [deploy-doc]
needs: [build]
if: contains(github.ref, 'tags')
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 7be60ad

Please sign in to comment.