-
Notifications
You must be signed in to change notification settings - Fork 30
161 lines (141 loc) · 5.1 KB
/
build_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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#common envs
env:
SNOWFLAKE_TEST_USER: ${{ secrets.SNOWFLAKE_TEST_USER }}
SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.SNOWFLAKE_TEST_WAREHOUSE }}
SNOWFLAKE_TEST_DATABASE: ${{ secrets.SNOWFLAKE_TEST_DATABASE }}
SNOWFLAKE_TEST_SCHEMA: ${{ secrets.SNOWFLAKE_TEST_SCHEMA }}
SNOWFLAKE_TEST_ROLE: ${{ secrets.SNOWFLAKE_TEST_ROLE }}
name: build_test
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
branches: [ master, simba-driverbuildtest-workflow ]
pull_request:
branches: [ master, simba-driverbuildtest-workflow ]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_test_windows:
strategy:
matrix:
# have to specify minor version on windows
# otherwise could get version mismatch issue when running test on github
# need to keep track on the latest version
php-version: ['8.0.30', '8.1.23', '8.2.10']
# The type of runner that the job will run on
runs-on: windows-2019
env:
ARCH: x64
TARGET: Release
VS: VS16
PHP: ${{ matrix.php-version }}
TEST_PHP_EXECUTABLE: c:\tools\php\php.exe
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: setup php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, json
env:
phpts: ts
- name: build driver
run: python .\.github\workflows\scripts\build_driver.py
shell: cmd
- name: test driver
run: python .\.github\workflows\scripts\test_driver.py
shell: cmd
build_test_linux:
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
PHP_HOME: /usr
TEST_PHP_EXECUTABLE: /usr/bin/php
NO_INTERACTION: true
USE_VALGRIND: 0
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: setup php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, json
coverage: xdebug2
- name: build driver
run: python ./.github/workflows/scripts/build_driver.py
- name: test driver
run: python ./.github/workflows/scripts/test_driver.py
build_test_mac:
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
# The type of runner that the job will run on
runs-on: macos-latest
env:
PHP_HOME: /usr/local
TEST_PHP_EXECUTABLE: /usr/local/bin/php
NO_INTERACTION: true
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: setup php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, json
- name: build driver
run: python ./.github/workflows/scripts/build_driver.py
- name: test driver
run: python ./.github/workflows/scripts/test_driver.py
code-coverage:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
REPORT_COVERAGE: 1
PHP_HOME: /usr
TEST_PHP_EXECUTABLE: /usr/bin/php
NO_INTERACTION: true
USE_VALGRIND: 0
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: setup php
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: pdo, json
coverage: xdebug2
- name: Setup LCOV
run: sudo apt-get -y install lcov
shell: bash
- name: build driver
run: python ./.github/workflows/scripts/build_driver.py
- name: test driver
run: python ./.github/workflows/scripts/test_driver.py
# codecov action sometimes fails but retry works - until action provides retry let's retry on our own https://github.com/codecov/codecov-action/issues/926
- name: Upload coverage reports to Codecov (take 1)
id: uploadToCodeCovTake1
uses: codecov/codecov-action@v3
continue-on-error: true
with:
gcov: true
verbose: true
fail_ci_if_error: true
- name: Upload coverage reports to Codecov (take 2)
id: uploadToCodeCovTake2
# only run when take 1 failed
if: steps.uploadToCodeCovTake1.outcome == 'failure'
uses: codecov/codecov-action@v3
with:
gcov: true
verbose: true
fail_ci_if_error: true