Nightly code check V2 #422
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |