Skip to content

Commit

Permalink
* Moved test workflow to CI workflow and added release on tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnapper7 committed Nov 30, 2022
1 parent cc5322a commit 68b1b7a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Test
name: CI

on:
push:
# branches: [main]
# pull_request:
branches:
- '*'
tags:
- '*.*.*'

env:
FORCE_COLOR: 1

jobs:
test:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -20,8 +22,11 @@ jobs:

steps:
- uses: actions/checkout@v3

# Note: config for poetry is in poetry.toml in package root dir
- name: Install poetry
run: pipx install "poetry==${{ matrix.poetry-version }}"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -42,5 +47,16 @@ jobs:
- name: Install package
run: poetry install --no-interaction

- name: Tests
- name: Run tests
run: poetry run pytest --capture=no

- name: Build package
if: ${{ github.ref_type == 'tag' }}
run: poetry build

- name: Publish tags to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.ref_type == 'tag' }}
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
2 changes: 2 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true

0 comments on commit 68b1b7a

Please sign in to comment.