-
Notifications
You must be signed in to change notification settings - Fork 33
138 lines (115 loc) · 3.96 KB
/
ci.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: BuildAndTest
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
USER: ${{ secrets.USER }}
PASSWORD: ${{ secrets.PASSWORD }}
PASSWORD_AIRLINE_USER: ${{ secrets.PASSWORD_AIRLINE_USER }}
PASSWORD_AIRLINE_USER_DBOWNER: ${{ secrets.PASSWORD_AIRLINE_USER_DBOWNER }}
DRIVER: "{ODBC Driver 17 for SQL Server}"
jobs:
R:
runs-on: [self-hosted, 1ES.Pool=sqlmlutils_GH_RunnerPool]
strategy:
matrix:
include:
- r-version: "3.5.2"
sql-platform: "box"
- r-version: "4.2.0"
sql-platform: "box"
env:
# Define CI to skip some test case.
CI: True
DATABASE: ${{ secrets.DATABASE }}
defaults:
run:
shell: cmd
steps:
- name: Set SQL Server 2019 Env_var for R 3.5.2
if: matrix.r-version == '3.5.2' && matrix.sql-platform == 'box'
run: echo SERVER=${{ secrets.SQL19SERVER }}>> %GITHUB_ENV%
shell: cmd
- name: Set SQL Server 2022 Env_var for R 4.2.0
if: matrix.r-version == '4.2.0' && matrix.sql-platform == 'box'
run: echo SERVER=${{ secrets.SQL22SERVER }}>> %GITHUB_ENV%
shell: cmd
- name: Check Connectivity to SQL Database
run: |
sqlcmd -S tcp:%SERVER%,1433 -U %USER% -P %PASSWORD% -d %DATABASE% -l 5 -Q "SELECT @@VERSION"
shell: cmd
- name: Checkout Branch
uses: actions/checkout@v2
- name: Set up R ${{ matrix.r-version }} Runtime
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install R Package Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
working-directory: ./R
extra-packages:
#Retrieves most recent odbc pkg from cran to avoid errors seen in older versions.
#Updated odbc pkg is still compatible with R >= 3.2.0
cran::odbc
cran::xml2
rcmdcheck
- uses: r-lib/actions/check-r-package@v2
with:
working-directory: ./R
Python:
runs-on: [self-hosted, 1ES.Pool=sqlmlutils_GH_RunnerPool]
strategy:
fail-fast: true
matrix:
include:
- python-version: "3.7.1"
sql-platform: "box"
- python-version: "3.10.5"
sql-platform: "box"
env:
CI: True
DATABASE: ${{ secrets.DATABASE_PYTHON }}
steps:
- name: Set SQL Server 2019 Env_var for Python 3.7.1
if: matrix.python-version == '3.7.1' && matrix.sql-platform == 'box'
run: echo SERVER=${{ secrets.SQL19SERVER }}>> %GITHUB_ENV%
shell: cmd
- name: Set SQL Server 2022 Env_var for Python 3.10.5
if: matrix.python-version == '3.10.5' && matrix.sql-platform == 'box'
run: echo SERVER=${{ secrets.SQL22SERVER }}>> %GITHUB_ENV%
shell: cmd
- name: Check Connectivity SQL Database
run: |
sqlcmd -S tcp:%SERVER%,1433 -U %USER% -P %PASSWORD% -d %DATABASE% -l 5 -Q "SELECT @@VERSION"
shell: cmd
- name: Checkout Branch
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: ./Python
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install -r requirements.txt
- name: Build Python Package
working-directory: ./Python
run: ./buildandinstall.cmd
- name: Run pytest
working-directory: ./Python/tests
run: |
pytest