-
-
Notifications
You must be signed in to change notification settings - Fork 108
69 lines (56 loc) · 1.59 KB
/
python.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
name: Python code checks
on:
push:
branches:
- "master"
pull_request:
branches-ignore:
- "demo-gifs"
- "gh-pages"
- "rust-demo"
- "samples"
jobs:
formatting-checks:
runs-on: ubuntu-latest
steps:
- name: Black formatting check
uses: psf/black@stable
with:
options: "--check --verbose --diff --color"
- name: isort formatting check
uses: isort/isort-action@master
with:
configuration: "--check-only --verbose --diff --color --profile black"
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Build taisun
uses: PyO3/maturin-action@v1
with:
command: develop
args: --release
- name: Run Pytest
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_AGENT: ${{ secrets.USER_AGENT }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
run: |
poetry run pytest --cov=./
- name: Send coverage data to Codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest'