Skip to content

Commit

Permalink
Refactor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bergercookie committed Aug 10, 2024
1 parent c2a5ce9 commit 9da39a3
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 62 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/ci.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Coverage
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: |
sudo ./scripts/install-taskwarrior.sh
poetry install --all-extras
poetry self add "poetry-dynamic-versioning[plugin]"
task --version
- name: Coverage
run: |
poetry run coverage run -m pytest --doctest-modules
poetry run coverage report
# Using --service=github + secrets.GITHUB_TOKEN for builds originating from PRs to work
# Not sure if both are required
# https://github.com/TheKevJames/coveralls-python/issues/252
- name: Coveralls
run: poetry run coveralls --service=github || poetry run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/install-software.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Install software
on:
push:
pull_request:
Expand All @@ -14,6 +14,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install with pip3 - no extras
run: |
pip3 install .
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Style and Linters
on:
push:
pull_request:
jobs:
style_and_linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Python Poetry Action
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.6.1"
- name: Install prerequisites
run: |
poetry install --all-extras
poetry self add "poetry-dynamic-versioning[plugin]"
- name: "Run pre-commit hooks"
uses: slamcore/[email protected]
with:
command_prefix: "poetry run"
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish package
on:
push:
pull_request:

jobs:
publish_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish package to pypi
uses: JRubics/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
plugins: "poetry-dynamic-versioning[plugin]"
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Python Poetry Action
uses: abatilo/[email protected]
with:
Expand Down

0 comments on commit 9da39a3

Please sign in to comment.