v2 Nightly code check #225
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: v2 Nightly code check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 4 * * *' # 4 am UTC every day | |
jobs: | |
code-check: | |
uses: ./.github/workflows/code-check.yml | |
unit-tests: | |
uses: ./.github/workflows/unit-tests.yml | |
secrets: | |
GIST_PAT: ${{ secrets.GIST_PAT }} | |
security-scan: | |
needs: [unit-tests] | |
uses: ./.github/workflows/security-scan.yml | |
secrets: | |
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # finish all jobs even if one fails | |
max-parallel: 2 | |
matrix: | |
os: ['ubuntu-latest', 'macos-13', 'windows-latest'] | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ".[dev]" | |
- name: Test with pytest | |
run: | | |
pytest tests/unit | |
- 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 }} | |
account: ${{ vars.FIREBOLT_ACCOUNT }} | |
api-endpoint: "api.staging.firebolt.io" | |
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} | |
- name: Restore cached failed tests | |
id: cache-tests-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
.pytest_cache/v/cache/lastfailed | |
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }} | |
- name: Run integration tests | |
env: | |
CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} | |
CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} | |
DATABASE_NAME: ${{ steps.setup.outputs.database_name }} | |
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} | |
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} | |
FIREBOLT_BASE_URL: "api.staging.firebolt.io" | |
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }} | |
run: | | |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration | |
- name: Save failed tests | |
id: cache-tests-save | |
uses: actions/cache/save@v3 | |
if: failure() | |
with: | |
path: | | |
.pytest_cache/v/cache/lastfailed | |
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }} | |
- name: Slack Notify of failure | |
if: failure() | |
id: slack | |
uses: firebolt-db/action-slack-nightly-notify@v1 | |
with: | |
os: ${{ matrix.os }} | |
programming-language: Python | |
language-version: ${{ matrix.python-version }} | |
notifications-channel: 'ecosystem-ci-notifications' | |
slack-api-key: ${{ secrets.SLACK_BOT_TOKEN }} |