diff --git a/.github/workflows/nightly-v0.yml b/.github/workflows/nightly-v0.yml index b3c2dbdc1b5..b17b6e46c05 100644 --- a/.github/workflows/nightly-v0.yml +++ b/.github/workflows/nightly-v0.yml @@ -5,7 +5,79 @@ on: - cron: '0 3 * * *' # 3 am UTC every day jobs: code-check: - uses: ./.github/workflows/nightly-workflow.yml + uses: ./.github/workflows/code-check.yml with: branch: 0.x - secrets: inherit + unit-tests: + uses: ./.github/workflows/unit-tests.yml + with: + branch: 0.x + secrets: + GIST_PAT: ${{ secrets.GIST_PAT }} + security-scan: + needs: [unit-tests] + uses: ./.github/workflows/security-scan.yml + with: + branch: 0.x + secrets: + FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} + 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-latest', 'windows-latest'] + python-version: ['3.7', '3.8', '3.9', '3.10'] + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + ref: 0.x + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ".[dev]" + + - name: Unit test with pytest + run: | + pytest tests/unit + + - name: Setup database and engine + id: setup + uses: firebolt-db/integration-testing-setup@v1 + with: + firebolt-username: ${{ secrets.FIREBOLT_USERNAME_STAGING }} + firebolt-password: ${{ secrets.FIREBOLT_PASSWORD_STAGING }} + api-endpoint: "api.staging.firebolt.io" + region: "us-east-1" + + - name: Run integration tests + env: + USER_NAME: ${{ secrets.FIREBOLT_USERNAME_STAGING }} + PASSWORD: ${{ secrets.FIREBOLT_PASSWORD_STAGING }} + DATABASE_NAME: ${{ steps.setup.outputs.database_name }} + ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} + STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} + ACCOUNT_NAME: "firebolt" + API_ENDPOINT: "api.staging.firebolt.io" + run: | + pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration + + - 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 }} diff --git a/.github/workflows/nightly-workflow.yml b/.github/workflows/nightly-workflow.yml deleted file mode 100644 index 160b9c03c42..00000000000 --- a/.github/workflows/nightly-workflow.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Nightly workflow -on: - workflow_call: - inputs: - branch: - required: true - type: string - description: 'Branch to run on' -jobs: - code-check: - uses: ./.github/workflows/code-check.yml - with: - branch: ${{ inputs.branch }} - unit-tests: - uses: ./.github/workflows/unit-tests.yml - with: - branch: ${{ inputs.branch }} - secrets: - GIST_PAT: ${{ secrets.GIST_PAT }} - security-scan: - needs: [unit-tests] - uses: ./.github/workflows/security-scan.yml - with: - branch: ${{ inputs.branch }} - secrets: - FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} - 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-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9', '3.10'] - steps: - - name: Check out code - uses: actions/checkout@v2 - with: - ref: ${{ inputs.branch }} - - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install ".[dev]" - - - name: Unit 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 }} - api-endpoint: "api.staging.firebolt.io" - account: "developer" - db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} - - - name: Run integration tests - env: - SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} - SERVICE_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 }} - ACCOUNT_NAME: "developer" - API_ENDPOINT: "api.staging.firebolt.io" - run: | - pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration - - - 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 }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 52d89382dff..3d69c1192a9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,11 +1,76 @@ name: Nightly code check on: workflow_dispatch: - # schedule: - # - cron: '0 3 * * *' # 3 am UTC every day + schedule: + - cron: '0 3 * * *' # 3 am UTC every day jobs: code-check: - uses: ./.github/workflows/nightly-workflow.yml - with: - branch: main - secrets: inherit + 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: + FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} + 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-latest', 'windows-latest'] + python-version: ['3.7', '3.8', '3.9', '3.10'] + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ".[dev]" + + - name: Unit 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 }} + api-endpoint: "api.staging.firebolt.io" + account: "developer" + db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} + + - name: Run integration tests + env: + SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} + SERVICE_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 }} + ACCOUNT_NAME: "developer" + API_ENDPOINT: "api.staging.firebolt.io" + run: | + pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration + + - 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 }}