diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..bb2d259 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,78 @@ +name: Nightly code check +on: + workflow_dispatch: + schedule: + - cron: '0 3 * * *' # 3 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: + 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: Test with pytest + run: | + pytest tests/unit + + - name: Setup database and engine + id: setup + uses: firebolt-db/integration-testing-setup@master + with: + firebolt-username: ${{ secrets.FIREBOLT_USERNAME }} + firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }} + api-endpoint: "api.dev.firebolt.io" + region: "us-east-1" + db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} + + - name: Run integration tests + env: + USER_NAME: ${{ secrets.FIREBOLT_USERNAME }} + PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }} + DATABASE_NAME: ${{ steps.setup.outputs.database_name }} + ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} + ENGINE_URL: ${{ steps.setup.outputs.engine_url }} + STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} + STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }} + ACCOUNT_NAME: "firebolt" + FIREBOLT_BASE_URL: "api.dev.firebolt.io" + run: | + pytest -o log_cli=true -o log_cli_level=INFO tests/integration + + - name: Slack Notify of failure + if: failure() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_USERNAME: CI bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_COLOR: "#FF0000" + SLACK_ICON: None + SLACK_TITLE: Nightly tests failed + SLACK_MESSAGE: Please investigate diff --git a/setup.cfg b/setup.cfg index 04e8849..cf5202a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ classifiers = Operating System :: OS Independent Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -26,9 +25,9 @@ project_urls = [options] packages = find: install_requires = - firebolt-sdk>=0.8.0 + firebolt-sdk>=0.9.0 sqlalchemy>=1.0.0 -python_requires = >=3.6 +python_requires = >=3.7 package_dir = = src