This repository has been archived by the owner on May 1, 2023. It is now read-only.
-
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.
Merge branch 'main' of https://github.com/Aarhus-Psychiatry-Research/…
- Loading branch information
Showing
5 changed files
with
83 additions
and
38 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,78 @@ | ||
name: Semantic Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
python-version: [3.9] | ||
|
||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
### Caching | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.1.15 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2.1.6 | ||
with: | ||
path: | | ||
.venv | ||
poetry.lock | ||
# Cache the complete venv dir for a given os, python version, pyproject.toml | ||
key: venv-${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.github/workflows/cache_version') }} | ||
|
||
### Installing | ||
- name: Install Project | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install -vvv | ||
|
||
### Run tests | ||
- name: Run pytest | ||
run: | | ||
poetry run pytest --cov=src --cov-report term-missing --color=yes | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
needs: test | ||
|
||
steps: | ||
# Checkout action is required for token to persist | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.MB_PERSONAL_ACCESS_TOKEN }} | ||
|
||
- name: Python Semantic Release | ||
uses: relekang/python-semantic-release@v7.32.0 | ||
with: | ||
github_token: ${{ secrets.MB_PERSONAL_ACCESS_TOKEN}} | ||
# Remember to copy the tool.semantic_release section from pyproject.toml | ||
# as well | ||
# To enable pypi, | ||
# 1) Set upload_to_pypi to true in pyproject.toml and | ||
# 2) Set the pypi_token in the repo | ||
# 3) Uncomment the two lines below | ||
# repository_username: __token__ | ||
# repository_password: ${{ secrets.PYPI_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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 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 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