forked from yukinarit/pyserde
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (112 loc) · 3.43 KB
/
test.yml
File metadata and controls
118 lines (112 loc) · 3.43 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Tests
on: [pull_request]
jobs:
test:
name: Python [${{ matrix.python-version }}] on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Remove pypy-3.8 until it supports numpy
python-version: ["3.7", "3.8", "3.9", "3.10"] # "pypy-3.8"
os: [ubuntu-20.04, macos-10.15, windows-2019]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# - name: Restore pip cache
# # Caching on Windows is turned off due to inconsistent behaviour
# if: matrix.os != 'windows-2019'
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: ${{ matrix.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/Pipfile') }}
- name: Install dependencies
run: |
pip install poetry
make setup
- name: Run tests
run: |
make test
make examples
- name: Run orjson tests
run: |
pip install orjson
make test
make examples
check_formatting:
name: Check formatting
needs: test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
# - name: Restore pip cache
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: ubuntu-20.04-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml', '**/pyproject.toml') }}
- name: Install dependencies
run: |
pip install pre-commit
pre-commit install
- name: Check formatting
run: pre-commit run -a
- name: Comment PR
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@1.0.2
with:
message: 'Please consider formatting your code according to the standards described here: https://github.com/yukinarit/pyserde/blob/master/CONTRIBUTING.md'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check_coverage:
name: Check coverage
needs: test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
# - name: Restore pip cache
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: ubuntu-20.04-${{ env.pythonLocation }}-${{ hashFiles('**/Pipfile') }}
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Check coverage
run: make coverage
- name: Upload coverage report to codecov.io
uses: codecov/codecov-action@v1
run_benchmark:
name: Run benchmark
needs: test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: "3.7"
# - name: Restore pip cache
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: ubuntu-20.04-${{ env.pythonLocation }}-${{ hashFiles('**/Pipfile') }}
- name: Install dependencies
run: |
pip install poetry
make setup-bench
- name: Run benchmark
run: make bench