-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (67 loc) · 1.92 KB
/
test_and_version.yml
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
67
68
69
---
# This workflow will install Python dependencies, run tests
# Depending on commit messages it will update version and push new commit
name: Test and Version
on:
push:
branches: [master]
tags-ignore: [v*]
pull_request:
branches: [master]
tags-ignore: [v*]
jobs:
check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e ".[dev]"
- name: Check style with ruff
run: |
ruff check .
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e ".[test]"
- name: Test with pytest
run: |
pytest --cov replete .
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Rizhiy/replete
release:
if: ${{ github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'Automatically generated by python-semantic-release') }}
runs-on: ubuntu-latest
needs: [check-style, test]
concurrency: release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Install dependencies
run: |
pip install --upgrade pip
pip install python-semantic-release
pip install -U requests
- name: Update version and push
run: |-
semantic-release version