150 lines (144 loc) · 4.36 KB
/
validate.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
name: Validate
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
strategy:
matrix:
python-version: [
"2.7",
"3.5",
"3.6",
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"pypy-2.7",
"pypy-3.8",
]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- python-version: "2.7"
os: "ubuntu-latest"
- python-version: "2.7"
os: "windows-latest"
- python-version: "2.7"
os: "macos-latest"
- python-version: "3.5"
os: "ubuntu-latest"
- python-version: "3.6"
os: "ubuntu-latest"
include:
- python-version: "2.7"
os: "ubuntu-20.04"
- python-version: "3.5"
os: "ubuntu-20.04"
- python-version: "3.6"
os: "ubuntu-20.04"
runs-on: ${{ matrix.os }}
env:
TOXENV: py
steps:
- uses: actions/checkout@v3
- if: ${{ matrix.python-version == '2.7' }}
run: |
sudo apt-get install python-is-python2
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
- if: ${{ matrix.python-version != '2.7' }}
name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install -U tox six
- name: Install zic (Windows)
run: |
curl https://get.enterprisedb.com/postgresql/postgresql-9.5.21-2-windows-x64-binaries.zip --output $env:GITHUB_WORKSPACE\postgresql9.5.21.zip
unzip -oq $env:GITHUB_WORKSPACE\postgresql9.5.21.zip -d .postgresql
if: runner.os == 'Windows'
- name: Run updatezinfo.py (Windows)
run: |
$env:Path += ";$env:GITHUB_WORKSPACE\.postgresql\pgsql\bin"
ci_tools/retry.bat python updatezinfo.py
if: runner.os == 'Windows'
- name: Run updatezinfo.py (Unix)
run: ./ci_tools/retry.sh python updatezinfo.py
if: runner.os != 'Windows'
- name: Run tox
run: python -m tox
- name: Generate coverage.xml
run: python -m tox -e coverage
- name: Report coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./.tox/coverage.xml
name: ${{ matrix.os }}:${{ matrix.python-version }}
fail_ci_if_error: true
other:
runs-on: "ubuntu-latest"
strategy:
matrix:
toxenv: ["docs", "tz", "precommit"]
env:
TOXENV: ${{ matrix.toxenv }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: ${{ matrix.toxenv }}
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install -U tox
- name: Run action
run: tox
darker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: akaihola/darker@0fb2501a3f6c1b2d64976afa57885aeec0601182
# pinned due to unreleased fix: https://github.com/akaihola/darker/issues/489
with:
options: "--check --diff --color --isort"
src: "."
version: "~=1.7.1"
build-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install -U tox
- name: Run tox
run: python -m tox -e build
- name: Check generation
run: |
exactly_one() {
value=$(find dist -iname $1 | wc -l)
if [ $value -ne 1 ]; then
echo "Found $value instances of $1, not 1"
return 1
else
echo "Found exactly 1 instance of $value"
fi
}
# Check that exactly one tarball and one wheel are created
exactly_one '*.tar.gz'
exactly_one '*.whl'