-
Notifications
You must be signed in to change notification settings - Fork 17
68 lines (57 loc) · 1.95 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
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
name: Python ${{ matrix.python-version }}-${{ matrix.pymongo-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.9
- '3.10'
- '3.11'
- '3.12'
- pypy3.9
pymongo-version:
- pymongo3
- pymongo4
services:
mongodb:
image: mongo:4
ports:
- 27017:27017
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
- name: Run tox targets for ${{ matrix.python-version }}
# sed is used to remove the '.' so '3.7' becomes '37' for tox (and pypy3 doesn't become pypypy3)
# and drop the '-dev' from any prerelease version
run: |
export PY_VER=`echo ${{ matrix.python-version }} | sed s/\\\.// | sed s/pypy/py/ | sed s/-dev//`
tox --skip-missing-interpreters false -e "py$PY_VER-${{ matrix.pymongo-version }}"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
flags: tests-${{ matrix.python-version }}
name: codecov-umbrella
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}