-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (65 loc) · 2.45 KB
/
nightly-v2.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
name: Nightly code check V2
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # 2 am UTC every day
jobs:
code-check:
uses: ./.github/workflows/code-check.yml
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # finish all jobs even if one fails
max-parallel: 2
matrix:
os: ['macos-13', 'windows-latest', 'ubuntu-latest']
go-version: ['1.16', '1.17', '1.18', '1.19']
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install go tools
run: go get golang.org/x/tools/cmd/cover
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
api-endpoint: "api.staging.firebolt.io"
account: ${{ vars.FIREBOLT_ACCOUNT }}
- name: Run integration tests
env:
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
FIREBOLT_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
LONG_TEST_VALUE: ${{ vars.LONG_TEST_VALUE }}
run: |
go test . -timeout=30m -v -coverprofile cover.out --tags=integration
- name: Print coverage percent
id: coverage
continue-on-error: true
run: |
percentage=$(go tool cover -func=cover.out | tail -n 1 | awk '{print $3}' | awk -F'%' '{ print $1 }')
percentage_whole=$(echo "${percentage%.*}")
echo "covered=$percentage_whole" >> $GITHUB_OUTPUT
- name: Slack Notify of failure
if: failure()
id: slack
uses: firebolt-db/action-slack-nightly-notify@v1
with:
os: ${{ matrix.os }}
programming-language: GO
language-version: ${{ matrix.go-version }}
notifications-channel: 'ecosystem-ci-notifications'
slack-api-key: ${{ secrets.SLACK_BOT_TOKEN }}