Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit 7797b97

Browse files
committed
Improve github actions
1 parent a1982cb commit 7797b97

3 files changed

Lines changed: 66 additions & 39 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
on: [push, pull_request, workflow_call]
3+
jobs:
4+
check-format:
5+
name: Check format
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- uses: excitedleigh/setup-nox@v2.1.0
10+
- run: nox -s check_format
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: excitedleigh/setup-nox@v2.1.0
17+
- run: nox -s lint
18+
type-check:
19+
name: Type check
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: excitedleigh/setup-nox@v2.1.0
24+
- run: nox -s mypy
25+
tests:
26+
name: Test
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
venv_version: ["3.9", "3.10", "3.11"]
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: excitedleigh/setup-nox@v2.1.0
35+
- if: matrix.venv_version == '3.11'
36+
uses: actions/setup-python@v3.1.2
37+
with:
38+
python-version: "3.11-dev"
39+
- run: nox -s test-${{ matrix.venv_version }} --error-on-missing-interpreters
40+
- name: "Upload coverage to Codecov"
41+
uses: codecov/codecov-action@v2

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["v*.*.*"]
5+
jobs:
6+
CI:
7+
uses: ./.github/workflows/ci.yml
8+
publish:
9+
name: Publish to PyPI
10+
needs: [CI]
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v3
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: "3.10"
19+
- name: Install flit
20+
run: pip install flit~=3.7
21+
- name: Build and publish
22+
run: flit publish
23+
env:
24+
FLIT_USERNAME: __token__
25+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

.github/workflows/run-nox.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)