forked from michiya/django-pyodbc-azure
-
Notifications
You must be signed in to change notification settings - Fork 51
119 lines (95 loc) · 3.38 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
DATABASE_URL: "mssql://SA:MyPassword42@localhost:1433/default?isolation_level=read committed&driver=ODBC Driver 17 for SQL Server"
DATABASE_URL_OTHER: "mssql://SA:MyPassword42@localhost:1433/other?isolation_level=read committed&driver=ODBC Driver 17 for SQL Server"
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Install
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Linting
run: |
flake8 --exclude testapp
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
tox_env:
- "py36-django22"
- "py36-django30"
- "py36-django31"
- "py37-django22"
- "py37-django30"
- "py37-django31"
- "py38-django30"
- "py38-django31"
include:
- python: "3.6"
tox_env: "py36-django22"
- python: "3.6"
tox_env: "py36-django30"
- python: "3.6"
tox_env: "py36-django31"
- python: "3.7"
tox_env: "py37-django22"
- python: "3.7"
tox_env: "py37-django30"
- python: "3.7"
tox_env: "py37-django31"
- python: "3.8"
tox_env: "py38-django30"
- python: "3.8"
tox_env: "py38-django31"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: django/django
path: django
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install Linux deps
if: matrix.os == 'ubuntu-latest'
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 g++ unixodbc-dev libmemcached-dev
- name: Install Windows deps
if: matrix.os == 'windows-latest'
run: |
powershell wget https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/msodbcsql_17.3.1.1_x64.msi -OutFile msodbcsql_17.3.1.1_x64.msi
powershell "Start-Process msiexec.exe -Wait -ArgumentList '/I msodbcsql_17.3.1.1_x64.msi /qn /norestart IACCEPTMSODBCSQLLICENSETERMS=YES'"
- name: Install
run: |
python -m pip install --upgrade pip wheel setuptools
pip install tox tox-venv
- name: Test Linux
if: matrix.os == 'ubuntu-latest'
run: |
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyPassword42' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu
tox -e ${{ matrix.tox_env }}
- name: Test Windows
if: matrix.os == 'windows-latest'
run: |
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyPassword42' -p 1433:1433 -d christianacca/mssql-server-windows-express:1809
tox -e ${{ matrix.tox_env }}