Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Sep 30, 2022
2 parents 4638a64 + 3c57117 commit 91fd827
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 38 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/main_test_and_release.yml
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 }}
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: CI Pytest
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

Expand All @@ -23,10 +21,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

## setup chromedriver for saving Altair plots
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@v1.0.7

### Caching
- name: Install Poetry
uses: snok/install-poetry@v1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<!--next-version-placeholder-->

## v0.1.4 (2022-09-30)
### Fix
* Automerge with MB PAT ([`e708d64`](https://github.com/Aarhus-Psychiatry-Research/psycop-t2d/commit/e708d6479287c76133c2becc13d43b84b91d0abe))

## v0.1.3 (2022-09-29)
### Fix
* Add PAT to checkout for it to persist for python semantic release ([`3af0ae6`](https://github.com/Aarhus-Psychiatry-Research/psycop-t2d/commit/3af0ae6c4303d69235acfd0f4f929406068210d4))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "psycopt2d"
version = "0.1.3"
version = "0.1.4"
description = "Training scripts for the psycop-t2d project"
authors = ["Your Name <you@example.com>"]

Expand Down

0 comments on commit 91fd827

Please sign in to comment.