-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.3 KB
/
python-lib.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Python library
on:
push:
branches: [ main ]
tags:
- "v*.*.*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: poetry
- name: Install dependencies
run: poetry install
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Check files
run: poetry run pre-commit run --all-files
- name: Report test coverage to Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: coverage.xml:coverage.py
- name: Build and release to PyPi
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build
if: startsWith(github.ref, 'refs/tags/')
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
if: startsWith(github.ref, 'refs/tags/')