Skip to content

Commit

Permalink
fix(ci): rework workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Aug 21, 2023
1 parent 27cd5d4 commit aff092c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 45 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/nox.yml → .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@

name: Nox
name: Checks

on:
pull_request:
push:
workflow_dispatch:

jobs:
pre-commit:
checks:
runs-on: ubuntu-latest
matrix:
check: ["test", "lint"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Nox
uses: excitedleigh/setup-nox@v2.1.0
- name: Run nox tests
run: nox -rs test
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Run nox ${{ matrix.check }}
run: |
poetry install
poetry run nox -rs ${{ matrix.check }}
20 changes: 0 additions & 20 deletions .github/workflows/pre-commit.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: Publish

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Run nox publish
run: |
poetry install
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --repository pypi
19 changes: 0 additions & 19 deletions .github/workflows/pypi.yml

This file was deleted.

7 changes: 7 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import nox


@nox.session
def lint(session: nox.Session) -> None:
session.install("poetry")
session.run("poetry", "install")
session.run("pre-commit", "run", "-a")


@nox.session
def test(session: nox.Session) -> None:
session.install("poetry")
Expand Down

0 comments on commit aff092c

Please sign in to comment.