forked from dbfixtures/pytest-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.84 KB
/
tests-macos.yml
File metadata and controls
64 lines (61 loc) · 1.84 KB
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
name: Run tests on macos
on:
push:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/tests-macos.yml
- requirements-test.txt
- requirements-test-withpsycopg.txt
pull_request:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/tests-macos.yml
- requirements-test.txt
- requirements-test-withpsycopg.txt
jobs:
macostests:
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.7-v7.3.3]
postgres-version: [12, 13, 14]
env:
OS: macos-latest
PYTHON: ${{ matrix.python-version }}
POSTGRES: ${{ matrix.postgres-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install postgresql
run: |
brew install postgresql@${{ matrix.postgres-version }}
- name: Check installed locales
run: |
locale -a
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test-withpsycopg.txt
- name: Install dependencies
run: |
echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV
- name: Run test
run: |
py.test -n 0 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml
- uses: actions/upload-artifact@v3
if: failure()
with:
name: postgresql-${{ matrix.python-version }}-${{ matrix.postgres-version }}
path: /${{ env.TMPDIR }}/pytest-of-runner/**
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
flags: macos
env_vars: OS, PYTHON, POSTGRES
fail_ci_if_error: true