-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (104 loc) · 3.75 KB
/
test.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
name: test
on:
release:
types: [created]
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write # allows the JWT to be requested from GitHub's OIDC provider
contents: read # This is required for actions/checkout
jobs:
tests:
name: matrix test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- .
- sqlconnect/internal
- sqlconnect/internal/bigquery
- sqlconnect/internal/databricks
- sqlconnect/internal/mysql
- sqlconnect/internal/postgres
- sqlconnect/internal/redshift
- sqlconnect/internal/snowflake
- sqlconnect/internal/trino
include:
- package: .
exclude: sqlconnect-go/sqlconnect/internal
- package: sqlconnect/internal
exclude: sqlconnect-go/sqlconnect/internal/(bigquery|databricks|mysql|postgres|redshift|snowflake|trino)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
check-latest: true
- run: go version
- run: go mod download
- name: disable ipv6
run: |
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
- name: Run tests
run: |
FORCE_RUN_INTEGRATION_TESTS=true make test exclude="${{ matrix.exclude }}" package=${{ matrix.package }}
env:
REDSHIFT_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.REDSHIFT_TEST_ENVIRONMENT_CREDENTIALS }}
REDSHIFT_DATA_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.REDSHIFT_DATA_TEST_ENVIRONMENT_CREDENTIALS }}
REDSHIFT_DATA_TEST_ENVIRONMENT_ROLE_ARN_CREDENTIALS: ${{ secrets.REDSHIFT_DATA_TEST_ENVIRONMENT_ROLE_ARN_CREDENTIALS }}
SNOWFLAKE_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.SNOWFLAKE_TEST_ENVIRONMENT_CREDENTIALS }}
BIGQUERY_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.BIGQUERY_TEST_ENVIRONMENT_CREDENTIALS }}
DATABRICKS_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.DATABRICKS_TEST_ENVIRONMENT_CREDENTIALS }}
TRINO_TEST_ENVIRONMENT_CREDENTIALS: ${{ secrets.TRINO_TEST_ENVIRONMENT_CREDENTIALS }}
SNOWFLAKE_TEST_AUTH_KEYPAIR_ENCRYPTED_CREDENTIALS: ${{ secrets.SNOWFLAKE_TEST_AUTH_KEYPAIR_ENCRYPTED_CREDENTIALS }}
SNOWFLAKE_TEST_AUTH_KEYPAIR_UNENCRYPTED_CREDENTIALS: ${{ secrets.SNOWFLAKE_TEST_AUTH_KEYPAIR_UNENCRYPTED_CREDENTIALS }}
- name: Sanitize name for Artifact
run: |
name=$(echo -n "${{ matrix.package }}" | sed -e 's/[ \t:.\/\\"<>|*?]/_/g' -e 's/--*/-/g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}_profile.out
path: profile.out
coverage:
name: coverage
runs-on: 'ubuntu-20.04'
needs:
- tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23
check-latest: true
- name: Download coverage reports
uses: actions/download-artifact@v4
- name: Merge Coverage
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge */profile.out > profile.out
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./profile.out
token: ${{ secrets.CODECOV_TOKEN }}
all-green:
name: all-tests
if: always()
runs-on: ubuntu-latest
needs:
- tests
steps:
- uses: re-actors/alls-green@v1.2.2
with:
jobs: ${{ toJSON(needs) }}