diff --git a/.github/workflows/main_test_and_release.yml b/.github/workflows/main_test_and_release.yml new file mode 100644 index 00000000..74f8d0f4 --- /dev/null +++ b/.github/workflows/main_test_and_release.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d3a642e9..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Semantic Release - -on: - push: - branches: - - main - -jobs: - release: - runs-on: ubuntu-latest - concurrency: release - - 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 }} \ No newline at end of file diff --git a/.github/workflows/pytest.yml b/.github/workflows/test_prs.yml similarity index 88% rename from .github/workflows/pytest.yml rename to .github/workflows/test_prs.yml index a84cbd3b..e12825c7 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/test_prs.yml @@ -1,7 +1,5 @@ name: CI Pytest on: - push: - branches: [ main, dev ] pull_request: branches: [ main, dev ] @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index d35bc180..6d21e41b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ +## 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)) diff --git a/pyproject.toml b/pyproject.toml index df3b0ff4..024d7e1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "]