-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be0976
commit 7be60ad
Showing
1 changed file
with
26 additions
and
7 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 |
---|---|---|
@@ -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: | ||
#---------------------------------------------- | ||
|
@@ -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 | ||
#---------------------------------------------- | ||
|
@@ -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: | ||
|