-
Notifications
You must be signed in to change notification settings - Fork 102
76 lines (72 loc) · 2.99 KB
/
tests-on-push.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
name: Tests against selected versions of Python and MongoDB
on: [push]
jobs:
basic:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.12']
mongodb-version: ['4.0', '4.2', '4.4', '8.0']
steps:
- uses: actions/checkout@v4
- name: Start MongoDB on port 27017
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: pip install tox
- name: Run basic tests in tox
run: tox -f py${{ matrix.python-version }} basic
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.mongodb-version }}-${{ matrix.python-version }}
path: htmlcov
advanced:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8']
mongodb-version: ['8.0']
steps:
- uses: actions/checkout@v4
- name: Install MongoDB ${{ matrix.mongodb-version }}
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongodb-version }}.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongodb-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongodb-version }}.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades mongodb-org-server
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox and any other packages
run: pip install tox
- name: Run advanced tests in tox
run: tox -f py${{ matrix.python-version }} advanced
advanced_old_mongo:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8']
mongodb-version: ['4.0']
steps:
- uses: actions/checkout@v4
- name: Install MongoDB ${{ matrix.mongodb-version }}
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongodb-version }}.asc | sudo apt-key add -
echo "deb [ trusted=yes arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/${{ matrix.mongodb-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongodb-version }}.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades mongodb-org-server
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox and any other packages
run: pip install tox
- name: Run advanced tests in tox
run: tox -f py${{ matrix.python-version }} advanced