-
Notifications
You must be signed in to change notification settings - Fork 57
84 lines (77 loc) · 2.3 KB
/
ci.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
name: Test and Lint
on:
# Triggers the workflow on push or pull request events.
push:
# This should disable running the workflow on tags, according to the
# on.<push|pull_request>.<branches|tags> GitHub Actions docs.
branches:
- "*"
pull_request:
types: [opened, reopened, synchronize]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs.
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
# This job aggregates all matrix results and is used for a GitHub required status check.
test_results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Test Results
needs: [test-py39]
steps:
- run: |
result="${{ needs.test-py39.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
test-py39:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crdb-version: [
"cockroach:latest-v23.1",
"cockroach:latest-v23.2",
"cockroach:latest-v24.1"
]
db-alias: [
"psycopg2",
"asyncpg",
"psycopg"
]
env:
TOXENV: py39
TOX_VERSION: 3.23.1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Start CockroachDB
run: |
docker pull cockroachdb/${{ matrix.crdb-version }}
docker run --rm -d --name crdb -p 26257:26257 \
cockroachdb/${{ matrix.crdb-version }} start-single-node --insecure
- name: Install testrunner
run: pip install --user tox==${TOX_VERSION}
- name: Test
run: ${HOME}/.local/bin/tox -- --db=${{ matrix.db-alias }}
lint:
runs-on: ubuntu-latest
env:
TOXENV: py39
TOX_VERSION: 3.23.1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install testrunner
run: pip install --user tox==${TOX_VERSION}
- name: Lint
run: ${HOME}/.local/bin/tox -e lint