From 04ac4d8b65c7a63a0a099be7c8209a478ff4c33c Mon Sep 17 00:00:00 2001 From: Petro Tiurin <93913847+ptiurin@users.noreply.github.com> Date: Wed, 12 Jan 2022 14:34:49 +0000 Subject: [PATCH 1/3] feat: Adding release workflow --- .github/workflows/release.yml | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5228cac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Firebolt Python Release + +on: + workflow_dispatch: + inputs: + pre-release-tag: + required: false + description: 'Tag for pre-release (optional)' + major-release: + required: false + description: 'Trigger a major release (optional). Leave empty for regular release.' + +jobs: + integration-tests: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - 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" + + - 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 }} + API_ENDPOINT: "api.dev.firebolt.io" + run: | + pytest -o log_cli=true -o log_cli_level=INFO tests/integration + + publish: + runs-on: ubuntu-latest + permissions: + contents: write + needs: integration-tests + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.RELEASE_PAT }} + + - name: 'Publish action' + uses: firebolt-db/action-python-release@main + with: + pre-release-tag: ${{ inputs.pre-release-tag }} + major-release: ${{ inputs.major-release }} + pypi-username: ${{ secrets.PYPI_USERNAME }} + pypi-password: ${{ secrets.PYPI_PASSWORD }} From 84f45b9a4b54b54724852309cb41a9cce1323fdc Mon Sep 17 00:00:00 2001 From: Petro Tiurin <93913847+ptiurin@users.noreply.github.com> Date: Wed, 12 Jan 2022 16:23:19 +0000 Subject: [PATCH 2/3] Add dependencies --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5228cac..2793c90 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,11 @@ jobs: with: python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[dev]" + - name: Setup database and engine id: setup uses: firebolt-db/integration-testing-setup@master From f211b9fbb39866835920b26b3446fb3afa644979 Mon Sep 17 00:00:00 2001 From: Petro Tiurin Date: Wed, 12 Jan 2022 16:28:09 +0000 Subject: [PATCH 3/3] standardise env names --- tests/integration/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 341a825..284ebb7 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -12,10 +12,10 @@ LOGGER = getLogger(__name__) -ENGINE_NAME_ENV = "engine_name" -DATABASE_NAME_ENV = "database_name" -USERNAME_ENV = "username" -PASSWORD_ENV = "password" +ENGINE_NAME_ENV = "ENGINE_NAME" +DATABASE_NAME_ENV = "DATABASE_NAME" +USERNAME_ENV = "USER_NAME" +PASSWORD_ENV = "PASSWORD" def must_env(var_name: str) -> str: