forked from python-semver/python-semver
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (87 loc) · 2.61 KB
/
Copy pathpython-testing.yml
File metadata and controls
96 lines (87 loc) · 2.61 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
name: Python
on:
push:
branches: [ "master", "main" ]
paths:
- 'pyproject.toml'
- '**.py'
- '.github/workflows/python-testing.yml'
pull_request:
branches: [ "master", "main" ]
paths:
- 'pyproject.toml'
- '**.py'
- '.github/workflows/python-testing.yml'
permissions:
contents: read
concurrency:
# only cancel in-progress runs of the same workflow
group: ${{ github.workflow }}-${{ github.ref }}
# ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
# Timout of 15min
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Output env variables
run: |
echo "Default branch=${default-branch}"
echo "GITHUB_WORKFLOW=${GITHUB_WORKFLOW}"
echo "GITHUB_ACTION=$GITHUB_ACTION"
echo "GITHUB_ACTIONS=$GITHUB_ACTIONS"
echo "GITHUB_ACTOR=$GITHUB_ACTOR"
echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY"
echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE"
echo "GITHUB_SHA=$GITHUB_SHA"
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
echo "GITHUB_BASE_REF=$GITHUB_BASE_REF"
echo "::debug::---Start content of file $GITHUB_EVENT_PATH"
cat $GITHUB_EVENT_PATH
echo "\n"
echo "::debug::---end"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: 3.8
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools setuptools-scm
pip install tox tox-gh-actions
- name: Check
run: |
tox -e checks
tests:
needs: check
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.7",
"3.8",
"3.9",
"3.10",
"3.11",
# "3.12-dev"
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox