-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (79 loc) · 2.56 KB
/
main.pull_request.workflow.yaml
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
---
name: "Pull Request verification"
on:
pull_request:
branches:
- main
jobs:
Tests:
name: "Tests | ${{ matrix.os }} | Python ${{ matrix.python-version }}"
env:
USING_COVERAGE: '3.11'
USING_DOCS: '3.11'
USING_DIST: '3.11'
strategy:
fail-fast: false
matrix:
os: ["Ubuntu"]
python-version: ["3.11", "pypy-3.9"]
runs-on: "${{ matrix.os }}-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/[email protected]"
with:
python-version: "${{ matrix.python-version }}"
- uses: "abatilo/[email protected]"
- name: "Install dependencies"
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade coverage[toml] tox tox-gh-actions
poetry install
# - name: "Configure poetry"
# run: poetry config virtualenvs.in-project true
#
# - name: "Set up cache"
# uses: actions/cache@v2
# id: cache
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
#
# - name: "Ensure cache is healthy"
# if: steps.cache.outputs.cache-hit == 'true'
# run: timeout 10s poetry run pip --version || rm -rf .venv
- name: "Run tox targets for ${{ matrix.python-version }}"
run: tox
# - name: "Get coverage"
# if: "contains(env.USING_COVERAGE, matrix.python-version)"
# run: |
# set -xe
# tox -e coverage-report
# - name: "Upload coverage to Codecov"
# if: "contains(env.USING_COVERAGE, matrix.python-version)"
# uses: "codecov/codecov-action@v1"
# with:
# fail_ci_if_error: true
#
# - name: "Upload coverage artifacts"
# if: "contains(env.USING_DOCS, matrix.python-version)"
# uses: actions/upload-artifact@v3
# with:
# name: coverage
# path: .coverage-reports
- name: "Build package"
run: |
poetry build
- name: "Upload dist artifacts"
uses: actions/upload-artifact@v3
with:
name: package-dist-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}
path: dist/
- name: "Upload docs artifacts"
uses: actions/upload-artifact@v3
if: "contains(env.USING_DOCS, matrix.python-version)"
with:
name: docs
path: docs/_build/html