-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 2.12 KB
/
test.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
# This file was generated from skeleton-ci/[email protected].
# Instead of changing this particular file, you might want to alter the template:
# https://github.com/skeleton-ci/skeleton-python/tree/0.0.2rc-219-g781ce0c/project/.github/workflows/%23%25%20if%20tests%20%25%23test.yml%23%25%20endif%20%25%23.jinja
# IMPORTANT!
# Pinned versions of actions and Poetry are managed in a different repository.
# Do not submit PRs to this file unless for this repo specifically.
# To change this workflow globally, submit a PR to https://github.com/skeleton-ci/skeleton-python.
name: "Tests"
on: ["push"]
jobs:
test:
runs-on: "${{matrix.platform}}-latest"
environment: "Test"
strategy:
fail-fast: false
# https://blog.jaraco.com/efficient-use-of-ci-resources/
matrix:
python:
- "3.8"
- "3.12"
platform:
- "ubuntu"
- "macos"
- "windows"
include:
- python: "3.9"
platform: "ubuntu"
- python: "3.10"
platform: "ubuntu"
- python: "3.11"
platform: "ubuntu"
- python: "pypy3.10"
platform: "ubuntu"
env:
context: "${{matrix.python}}-${{matrix.platform}}"
timeout-minutes: 10
steps:
- uses: "actions/checkout@v4"
- name: "Install Poetry"
run: "pipx install poetry==1.8.2"
- name: "Set up Python ${{matrix.python}}"
uses: "actions/setup-python@v5"
with:
python-version: "${{matrix.python}}"
cache: "poetry"
- name: "Install the project"
run: "poetry install"
- name: "Run tests"
env:
PY_COLORS: 1 # Thanks @zanieb!
run: >
poetry run coverage run
--context=${{env.context}}
-m pytest --doctest-only -v .
- name: "Show coverage report"
run: "poetry run coverage report --show-missing --fail-under=0"
- run: "mv .coverage .coverage.${{env.context}}"
- name: "Upload coverage data file artifact"
uses: "actions/upload-artifact@v4"
with:
name: "coverage-${{env.context}}"
path: ".coverage.${{env.context}}"
overwrite: true