Skip to content

Commit

Permalink
Merge pull request #64 from narumiruna/workflow
Browse files Browse the repository at this point in the history
ci: improve GitHub workflows
  • Loading branch information
narumiruna authored Jun 16, 2023
2 parents 654ad79 + 3ffa97f commit 872fec5
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 34 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/lint.yml

This file was deleted.

26 changes: 20 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,31 @@ on:
jobs:
publish:
runs-on: ubuntu-latest

strategy:
max-parallel: 1
matrix:
python-version: [3.9]
poetry-version: [1.5.1]

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/[email protected]

- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
python-version: 3.9
poetry-version: ${{ matrix.poetry-version }}

- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
pip install poetry
poetry build -f wheel
poetry publish -u __token__ -p $PYPI_TOKEN
35 changes: 25 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
name: Test
name: Python

on:
push:

jobs:
test:
build:
runs-on: ubuntu-latest

strategy:
max-parallel: 1
matrix:
python-version: [3.9]
poetry-version: [1.5.1]

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Checkout
uses: actions/[email protected]

- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install dependencies
run: poetry install

- name: Lint
run: poetry run flake8 -v

- name: Test
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run: |
pip install .
pip install codecov pytest
coverage run -m pytest -v -s tests
codecov
poetry run coverage run -m pytest -v -s tests
poetry run codecov
Loading

0 comments on commit 872fec5

Please sign in to comment.