-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (65 loc) · 1.97 KB
/
push-main.yml
File metadata and controls
66 lines (65 loc) · 1.97 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Build, test, and run static analyses, and send reports to external services
# Runs only on pushing to main
name: Build & test
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version:
- "3.10"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build meta-dependencies
run: |
pip install poetry tox tox-gh-actions
- name: Test with tox
run: |
tox
- name: Update coveralls
run: |
pip install coveralls coverage[toml]
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- uses: codecov/codecov-action@v4
with:
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
release:
needs: build
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Git
run: |
git config --global user.name "semantic-release"
git config --global user.email "semantic-release@GitHub"
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@v9.12.0
with:
github_token: ${{ secrets.GH_TOKEN }}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}