-
Notifications
You must be signed in to change notification settings - Fork 67
79 lines (74 loc) · 2.12 KB
/
Copy pathpull_request.yml
File metadata and controls
79 lines (74 loc) · 2.12 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
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: read
statuses: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install packages
run: |
make install
- name: Linting
run: |
make lint
- name: Run tests
run: |
make test
- name: Send coverage to Coveralls
id: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
- name: Report Coveralls status
if: always()
env:
GH_TOKEN: ${{ github.token }}
COVERALLS_OUTCOME: ${{ steps.coveralls.outcome }}
COVERALLS_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
COVERALLS_URL: https://coveralls.io/github/${{ github.repository }}?branch=${{ github.head_ref || github.ref_name }}
run: |
state="success"
description="Coverage uploaded to Coveralls"
if [ "$COVERALLS_OUTCOME" != "success" ]; then
state="failure"
description="Coveralls upload failed"
fi
gh api \
--method POST \
repos/${{ github.repository }}/statuses/$COVERALLS_SHA \
-f state="$state" \
-f context="coverage/coveralls" \
-f target_url="$COVERALLS_URL" \
-f description="$description"
tox:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run Tox
run: tox -e py