-
Notifications
You must be signed in to change notification settings - Fork 18
67 lines (65 loc) · 2.21 KB
/
test.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
name: commcare-export tests
on:
pull_request:
branches:
- master
env:
DB_USER: db_user
DB_PASSWORD: Password123
jobs:
test:
runs-on: ubuntu-22.04
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
SA_PASSWORD: ${{ env.DB_PASSWORD }}
ACCEPT_EULA: 'Y'
ports:
- 1433:1433
postgres:
image: postgres
env:
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
POSTGRES_USER: ${{ env.DB_USER }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- run: git fetch --tags origin # So we can use git describe. actions/checkout@v3 does not pull tags.
# MySQL set up
- run: sudo service mysql start # Ubuntu already includes mysql no need to use service
- run: mysql -uroot -proot -e "CREATE USER '${{ env.DB_USER }}'@'%';"
- run: mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO '${{ env.DB_USER }}'@'%';"
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get install pandoc
- run: python setup.py sdist
- run: pip install --upgrade pip
- run: pip install dist/*
- run: pip install pymysql psycopg2 pyodbc
- run: pip install coverage coveralls
- run: pip install mypy
- run: pip install pytest
- run: pip install -e ".[test]"
- run: coverage run setup.py test
env:
POSTGRES_URL: postgresql://${{ env.DB_USER }}:${{ env.DB_PASSWORD }}@localhost/
MYSQL_URL: mysql+pymysql://${{ env.DB_USER }}:@localhost/
MSSQL_URL: mssql+pyodbc://sa:${{ env.DB_PASSWORD }}@localhost/
HQ_USERNAME: ${{ secrets.HQ_USERNAME }}
HQ_API_KEY: ${{ secrets.HQ_API_KEY }}
- run: mypy --install-types --non-interactive @mypy_typed_modules.txt
- run: coverage lcov -o coverage/lcov.info
- uses: coverallsapp/github-action@v1