Skip to content

Commit 60f2d6e

Browse files
authored
chore: initial ci configuration (#1)
1 parent 0a6a0e9 commit 60f2d6e

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/workflows/ci.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
pull_request:
12+
branches:
13+
- master
14+
15+
jobs:
16+
build:
17+
name: Build & Test
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: ["3.7", "3.8", "3.9", "3.10"]
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v3
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install Poetry
34+
uses: abatilo/actions-poetry@v2
35+
36+
- name: Install dependencies
37+
run: |
38+
poetry install
39+
40+
- name: Run tests
41+
run: |
42+
poetry run pytest
43+
44+
45+
lint:
46+
name: Lint
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Set up Python 3.9
52+
uses: actions/setup-python@v3
53+
with:
54+
python-version: 3.9
55+
56+
- name: Install Poetry
57+
uses: abatilo/actions-poetry@v2
58+
59+
- name: Install dependencies
60+
run: |
61+
poetry install
62+
63+
- name: Run tests
64+
run: |
65+
poetry run black --check .
66+

.github/workflows/pr-title-lint.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Lint PR Title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: PR Title Checks
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
# Optionally, you can provide options for further constraints.
19+
with:
20+
# Configure which types are allowed.
21+
# Default: https://github.com/commitizen/conventional-commit-types
22+
types: |
23+
chore
24+
docs
25+
feat
26+
fix
27+
refactor
28+
style
29+
test
30+
# Configure which scopes are allowed.
31+
scopes: |
32+
deps
33+
deps-dev
34+
# Configure that a scope must always be provided.
35+
requireScope: false
36+
# For work-in-progress PRs you can typically use draft pull requests
37+
# from Github. However, private repositories on the free plan don't have
38+
# this option and therefore this action allows you to opt-in to using the
39+
# special "[WIP]" prefix to indicate this state. This will avoid the
40+
# validation of the PR title and the pull request checks remain pending.
41+
# Note that a second check will be reported if this is enabled.
42+
wip: true

0 commit comments

Comments
 (0)