-
Notifications
You must be signed in to change notification settings - Fork 575
199 lines (193 loc) · 5.9 KB
/
main.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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Hypothesis CI
env:
# Tell pytest and other tools to produce coloured terminal output.
# Make sure this is also in the "passenv" section of the tox config.
PY_COLORS: 1
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
task:
- check-whole-repo-tests
- lint
- check-format
- check-coverage
- check-conjecture-coverage
- check-py37
- check-pypy37
- check-py38
- check-pypy38
- check-py39
- check-pypy39
- check-py310
# - check-py310-pyjion # see notes in tox.ini
- check-py311
- check-quality
- lint-ruby
- check-ruby-tests
- check-rust-in-ruby-format
- lint-rust-in-ruby
- audit-rust-in-ruby
- check-conjecture-rust-format
- check-rust-tests
- audit-conjecture-rust
- lint-conjecture-rust
- check-nose
- check-pytest46
- check-pytest54
- check-pytest62
- check-django40
- check-django32
- check-django22
- check-pandas13
- check-pandas12
- check-pandas11
- check-pandas10
- check-pandas25
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Restore cache
uses: actions/cache@v2
with:
path: |
~/.cache
~/wheelhouse
~/.local
vendor/bundle
key: deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}-${{ matrix.task }}
restore-keys: |
deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}
deps-${{ runner.os }}
- name: Install dotnet6 for Pyjion
if: ${{ endsWith(matrix.task, '-pyjion') }}
run: |
wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
- name: Run tests
run: TASK=${{ matrix.task }} ./build.sh
- name: Upload coverage data
uses: actions/upload-artifact@v2
# Invoke the magic `always` function to run on both success and failure.
if: ${{ always() && endsWith(matrix.task, '-coverage') }}
with:
name: ${{ matrix.task }}-data
path: |
hypothesis-python/.coverage*
!hypothesis-python/.coveragerc
hypothesis-python/branch-check
test-win:
runs-on: windows-latest
strategy:
matrix:
include:
- task: check-py38-x64
python.architecture: "x64"
- task: check-py38-x86
python.architecture: "x86"
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: ${{ matrix.python-architecture }}
- name: Restore cache
uses: actions/cache@v2
with:
path: |
~\appdata\local\pip\cache
vendor\bundle
key: deps-${{ runner.os }}-${{ matrix.python-architecture }}-${{ hashFiles('requirements/*.txt') }}-${{ matrix.task }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.python-architecture }}-${{ hashFiles('requirements/*.txt') }}
deps-${{ runner.os }}-${{ matrix.python-architecture }}
- name: Install dependencies
run: |
pip install --upgrade setuptools pip wheel
pip install -r requirements/coverage.txt
pip install hypothesis-python/[all]
- name: Run tests
run: python -m pytest --numprocesses auto hypothesis-python/tests/ --ignore=hypothesis-python/tests/quality/ --ignore=hypothesis-python/tests/ghostwriter/
test-osx:
runs-on: macos-latest
strategy:
matrix:
task:
- check-py38
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Restore cache
uses: actions/cache@v2
with:
path: |
~/.cache
~/Library/Caches/pip
key: deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}-${{ matrix.task }}
- name: Run tests
run: TASK=${{ matrix.task }} ./build.sh
deploy:
if: "github.event_name == 'push' && github.repository == 'HypothesisWorks/hypothesis'"
runs-on: ubuntu-latest
needs: [test, test-win, test-osx]
strategy:
matrix:
task:
- deploy
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Restore cache
uses: actions/cache@v2
with:
path: |
~/.cache
~/wheelhouse
~/.local
vendor/bundle
key: deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}-${{ matrix.task }}
restore-keys: |
deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}
deps-${{ runner.os }}
- name: Deploy package
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: TASK=${{ matrix.task }} ./build.sh