From ba47ace43ad379532b5b000694536d8695aa377e Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 19:48:22 +0100 Subject: [PATCH 01/19] ci: Add doc build action --- .../actions/build-documentation/action.yml | 25 +++++++++++++++++++ setup.cfg | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 .github/actions/build-documentation/action.yml diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml new file mode 100644 index 0000000000..7afda59c0f --- /dev/null +++ b/.github/actions/build-documentation/action.yml @@ -0,0 +1,25 @@ +name: 'Build Documentation' +description: 'Build the Sphinx documentation' + + +runs: + using: 'composite' + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + shell: bash + run: pip install -e .[docs] + + - name: Build Sphinx documentation + shell: bash + run: | + sphinx-build -M html docsrc docs_compiled + ls docs_compiled diff --git a/setup.cfg b/setup.cfg index 7535208484..e4206633b0 100755 --- a/setup.cfg +++ b/setup.cfg @@ -62,6 +62,9 @@ dev = pytest-xdist==2.5.0 trio-typing[mypy]==0.6.* types-cryptography==3.3.18 +doc = + sphinx + sphinx-rtd-theme [options.package_data] firebolt = py.typed From 1adf1813fe40fdbd07a090f5815d3c805532e0f7 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 19:50:12 +0100 Subject: [PATCH 02/19] fixes --- .github/actions/build-documentation/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index 7afda59c0f..b0eaeb18c3 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -7,10 +7,10 @@ runs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.x From 49f07a3c7d545d2bd98b3715e9277b22f16f4374 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 19:50:29 +0100 Subject: [PATCH 03/19] modifying int tests to test new action --- .github/workflows/integration-tests-v2.yml | 36 ++-------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 03a76ecd2b..28a21c5629 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -12,37 +12,5 @@ jobs: tests: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - 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@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_V1 }} - api-endpoint: "api.staging.firebolt.io" - - - 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 }} - API_ENDPOINT: "api.staging.firebolt.io" - ACCOUNT_NAME_V1: ${{ vars.FIREBOLT_ACCOUNT_V1 }} - ACCOUNT_NAME_V2: ${{ vars.FIREBOLT_ACCOUNT_V2 }} - run: | - pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration -k "not V1" --runslow + - name: Build Documentation + uses: ./github/actions/build-documentation From e0934394d08d31c8a4f1c4dd418a6655ba82bb4d Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 19:51:28 +0100 Subject: [PATCH 04/19] add actions checkout --- .github/workflows/integration-tests-v2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 28a21c5629..a7c54a98e8 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -12,5 +12,8 @@ jobs: tests: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Build Documentation uses: ./github/actions/build-documentation From 33e90cc450559a5289057f29748bf529efbc24d7 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 19:53:21 +0100 Subject: [PATCH 05/19] fix path --- .github/workflows/integration-tests-v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index a7c54a98e8..4806a691d4 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -16,4 +16,4 @@ jobs: uses: actions/checkout@v4 - name: Build Documentation - uses: ./github/actions/build-documentation + uses: ./.github/actions/build-documentation From 0372fbe0332e0eed74e2b06315a07d1efed55b95 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:16:25 +0100 Subject: [PATCH 06/19] using python sphinx module --- .github/actions/build-documentation/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index b0eaeb18c3..55067ff0c7 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -16,10 +16,12 @@ runs: - name: Install dependencies shell: bash - run: pip install -e .[docs] + run: | + pip install -U pip + pip install -e .[docs] - name: Build Sphinx documentation shell: bash run: | - sphinx-build -M html docsrc docs_compiled + python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled ls docs_compiled From f15c2d69f0a0e2419948addd6236ceac253c6d2a Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:18:26 +0100 Subject: [PATCH 07/19] add setuptools --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index e4206633b0..dfa1eb8eda 100755 --- a/setup.cfg +++ b/setup.cfg @@ -63,6 +63,7 @@ dev = trio-typing[mypy]==0.6.* types-cryptography==3.3.18 doc = + setuptools sphinx sphinx-rtd-theme From 86f240f11680faca4857b51123246f99c4bc9938 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:21:47 +0100 Subject: [PATCH 08/19] fix setup --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index dfa1eb8eda..5f51aaabe1 100755 --- a/setup.cfg +++ b/setup.cfg @@ -62,7 +62,7 @@ dev = pytest-xdist==2.5.0 trio-typing[mypy]==0.6.* types-cryptography==3.3.18 -doc = +docs = setuptools sphinx sphinx-rtd-theme From 17af78a05fa1af0d231c96d7113e8f3307953e7c Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:28:23 +0100 Subject: [PATCH 09/19] Add deploy step --- .github/actions/build-documentation/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index 55067ff0c7..ac4b01fe15 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -25,3 +25,10 @@ runs: run: | python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled ls docs_compiled + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs_compiled + destination_dir: docs From 39c1c5de2f7ed0ba0d8e61ffa916d4a5d00f8578 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:30:10 +0100 Subject: [PATCH 10/19] add secret input --- .github/actions/build-documentation/action.yml | 6 +++++- .github/workflows/integration-tests-v2.yml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index ac4b01fe15..f2a16c9b59 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -1,6 +1,10 @@ name: 'Build Documentation' description: 'Build the Sphinx documentation' +inputs: + github-token: + description: 'GitHub token' + required: true runs: using: 'composite' @@ -29,6 +33,6 @@ runs: - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ inputs.github-token }} publish_dir: ./docs_compiled destination_dir: docs diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 4806a691d4..5dfdd0ae3a 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -17,3 +17,5 @@ jobs: - name: Build Documentation uses: ./.github/actions/build-documentation + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From bab1da17962d4a52476803b1becae68d3231b9bd Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 20:55:55 +0100 Subject: [PATCH 11/19] cache --- .github/actions/build-documentation/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index f2a16c9b59..d6b0f31af9 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -18,6 +18,13 @@ runs: with: python-version: 3.x + - uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies shell: bash run: | From 28c76a3643127946d856547d19f39431d63b5234 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 21:01:14 +0100 Subject: [PATCH 12/19] remove docs from gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2e08a3ef5c..56c8d51999 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ docsrc/_build -docs/* !docs/requirements.txt .idea From 3b6f2d5421852c7e3e6a504cd91e52192cd57f8d Mon Sep 17 00:00:00 2001 From: ptiurin Date: Tue, 4 Jun 2024 21:09:04 +0100 Subject: [PATCH 13/19] test --- .github/actions/build-documentation/action.yml | 2 +- .gitignore | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml index d6b0f31af9..7e288f867e 100644 --- a/.github/actions/build-documentation/action.yml +++ b/.github/actions/build-documentation/action.yml @@ -42,4 +42,4 @@ runs: with: github_token: ${{ inputs.github-token }} publish_dir: ./docs_compiled - destination_dir: docs + destination_dir: sdk_docs diff --git a/.gitignore b/.gitignore index 56c8d51999..388483bc1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ docsrc/_build -!docs/requirements.txt .idea From 66fac447748f4d2c5fc9b200f18851219755efb8 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 10:45:12 +0100 Subject: [PATCH 14/19] pin major versions --- setup.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 5f51aaabe1..08b278955b 100755 --- a/setup.cfg +++ b/setup.cfg @@ -63,9 +63,8 @@ dev = trio-typing[mypy]==0.6.* types-cryptography==3.3.18 docs = - setuptools - sphinx - sphinx-rtd-theme + sphinx==7.* + sphinx-rtd-theme==2.* [options.package_data] firebolt = py.typed From cb02f4db025f3c7bd918eddcee31cc37be6f2185 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 10:45:21 +0100 Subject: [PATCH 15/19] test workflow instead --- .github/workflows/integration-tests-v2.yml | 45 ++++++++++++++++------ 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 5dfdd0ae3a..04928450fd 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -1,21 +1,44 @@ -name: Integration tests FB 2.0 +name: Build documenation + on: workflow_dispatch: - workflow_call: - secrets: - FIREBOLT_CLIENT_ID_STG_NEW_IDN: - required: true - FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: - required: true + release: + types: + - created jobs: - tests: + build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Build Documentation - uses: ./.github/actions/build-documentation + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + shell: bash + run: | + pip install -U pip + pip install -e .[docs] + + - name: Build Sphinx documentation + shell: bash + run: | + python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs_compiled + destination_dir: sdk_documenation/latest From 882f875862184903317360d8a67f995ad91181ba Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 11:17:49 +0100 Subject: [PATCH 16/19] final look --- .github/workflows/integration-tests-v2.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 04928450fd..817a38051b 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -18,7 +18,7 @@ jobs: with: python-version: 3.x - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} @@ -36,9 +36,25 @@ jobs: run: | python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled + - name: Resolve name tag + id: resolve_name_tag + shell: bash + run: | + if [[ -n "${{ github.event.inputs.custom-path }}" ]]; then + echo "::set-output name=path::${{ github.event.inputs.custom-path }}" + # 0.x releases deploy to 0.x path, all other releases deploy to latest path + elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name }}" == 0.* ]]; then + echo "::set-output name=path::0.x" + # for manual builds deploy to the branch name path + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "::set-output name=path::${{ github.ref_name }}" + else + echo "::set-output name=path::latest" + fi + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs_compiled - destination_dir: sdk_documenation/latest + destination_dir: sdk_documenation/${{ steps.resolve_name_tag.outputs.path }} From fd61284ead6204dc96ef236bea0ff8e677969d1c Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 11:26:12 +0100 Subject: [PATCH 17/19] output path --- .github/workflows/integration-tests-v2.yml | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 817a38051b..19f49d537a 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -1,4 +1,4 @@ -name: Build documenation +name: Integration tests FB 2.0 on: workflow_dispatch: @@ -40,17 +40,17 @@ jobs: id: resolve_name_tag shell: bash run: | - if [[ -n "${{ github.event.inputs.custom-path }}" ]]; then - echo "::set-output name=path::${{ github.event.inputs.custom-path }}" - # 0.x releases deploy to 0.x path, all other releases deploy to latest path - elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name }}" == 0.* ]]; then - echo "::set-output name=path::0.x" - # for manual builds deploy to the branch name path - elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "::set-output name=path::${{ github.ref_name }}" - else - echo "::set-output name=path::latest" - fi + if [[ -n "${{ github.event.inputs.custom-path }}" ]]; then + echo "path=${{ github.event.inputs.custom-path }}" >> $GITHUB_OUTPUT + # 0.x releases deploy to 0.x path, all other releases deploy to latest path + elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name }}" == 0.* ]]; then + echo "path=0.x" >> $GITHUB_OUTPUT + # for manual builds deploy to the branch name path + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "path=${{ github.ref_name }}" >> $GITHUB_OUTPUT + else + echo "path=latest" >> $GITHUB_OUTPUT + fi - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 @@ -58,3 +58,9 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs_compiled destination_dir: sdk_documenation/${{ steps.resolve_name_tag.outputs.path }} + + - name: Add URL to the Job Summary + shell: bash + run: | + url="https://docs.firebolt.io/firebolt-python-sdk/sdk_documenation/${{ steps.resolve_name_tag.outputs.path }}" + echo "[Documentation]($url)" >> $GITHUB_STEP_SUMMARY From 3aa26449d37d1313894c33537f20a66f3e17bcc6 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 11:34:49 +0100 Subject: [PATCH 18/19] Revert test wf and add build-doc --- .github/workflows/build-documentation.yml | 71 ++++++++++++++++++ .github/workflows/integration-tests-v2.yml | 84 +++++++++------------- 2 files changed, 104 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/build-documentation.yml diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml new file mode 100644 index 0000000000..95d7ecc24c --- /dev/null +++ b/.github/workflows/build-documentation.yml @@ -0,0 +1,71 @@ +name: Build documenation + +on: + workflow_dispatch: + inputs: + custom-path: + description: 'Custom path to deploy documentation to' + required: false + default: '' + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + shell: bash + run: | + pip install -U pip + pip install -e .[docs] + + - name: Build Sphinx documentation + shell: bash + run: | + python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled + + - name: Resolve url path + id: resolve_url_path + shell: bash + run: | + if [[ -n "${{ github.event.inputs.custom-path }}" ]]; then + echo "path=${{ github.event.inputs.custom-path }}" >> $GITHUB_OUTPUT + # 0.x releases deploy to 0.x path, all other releases deploy to latest path + elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name }}" == 0.* ]]; then + echo "path=0.x" >> $GITHUB_OUTPUT + # for manual builds deploy to the branch name path + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "path=${{ github.ref_name }}" >> $GITHUB_OUTPUT + else + echo "path=latest" >> $GITHUB_OUTPUT + fi + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs_compiled + destination_dir: sdk_documenation/${{ steps.resolve_url_path.outputs.path }} + + - name: Add URL to the Job Summary + shell: bash + run: | + url="https://docs.firebolt.io/firebolt-python-sdk/sdk_documenation/${{ steps.resolve_url_path.outputs.path }}" + echo "[Documentation]($url)" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 19f49d537a..03a76ecd2b 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -1,66 +1,48 @@ name: Integration tests FB 2.0 - on: workflow_dispatch: - release: - types: - - created + workflow_call: + secrets: + FIREBOLT_CLIENT_ID_STG_NEW_IDN: + required: true + FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: + required: true jobs: - build: + tests: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.x + - name: Check out code + uses: actions/checkout@v2 - - uses: actions/cache@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} - restore-keys: | - ${{ runner.os }}-pip- + python-version: 3.8 - name: Install dependencies - shell: bash - run: | - pip install -U pip - pip install -e .[docs] - - - name: Build Sphinx documentation - shell: bash - run: | - python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled - - - name: Resolve name tag - id: resolve_name_tag - shell: bash run: | - if [[ -n "${{ github.event.inputs.custom-path }}" ]]; then - echo "path=${{ github.event.inputs.custom-path }}" >> $GITHUB_OUTPUT - # 0.x releases deploy to 0.x path, all other releases deploy to latest path - elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name }}" == 0.* ]]; then - echo "path=0.x" >> $GITHUB_OUTPUT - # for manual builds deploy to the branch name path - elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "path=${{ github.ref_name }}" >> $GITHUB_OUTPUT - else - echo "path=latest" >> $GITHUB_OUTPUT - fi + python -m pip install --upgrade pip + pip install ".[dev]" - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 + - name: Setup database and engine + id: setup + uses: firebolt-db/integration-testing-setup@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs_compiled - destination_dir: sdk_documenation/${{ steps.resolve_name_tag.outputs.path }} - - - name: Add URL to the Job Summary - shell: bash + firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} + firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} + account: ${{ vars.FIREBOLT_ACCOUNT_V1 }} + api-endpoint: "api.staging.firebolt.io" + + - 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 }} + API_ENDPOINT: "api.staging.firebolt.io" + ACCOUNT_NAME_V1: ${{ vars.FIREBOLT_ACCOUNT_V1 }} + ACCOUNT_NAME_V2: ${{ vars.FIREBOLT_ACCOUNT_V2 }} run: | - url="https://docs.firebolt.io/firebolt-python-sdk/sdk_documenation/${{ steps.resolve_name_tag.outputs.path }}" - echo "[Documentation]($url)" >> $GITHUB_STEP_SUMMARY + pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration -k "not V1" --runslow From cd8a0d557c6189102d91352ee2041f8d175b7c23 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 5 Jun 2024 11:36:05 +0100 Subject: [PATCH 19/19] cleanup --- .../actions/build-documentation/action.yml | 45 ------------------- .gitignore | 2 + 2 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 .github/actions/build-documentation/action.yml diff --git a/.github/actions/build-documentation/action.yml b/.github/actions/build-documentation/action.yml deleted file mode 100644 index 7e288f867e..0000000000 --- a/.github/actions/build-documentation/action.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: 'Build Documentation' -description: 'Build the Sphinx documentation' - -inputs: - github-token: - description: 'GitHub token' - required: true - -runs: - using: 'composite' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.x - - - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install dependencies - shell: bash - run: | - pip install -U pip - pip install -e .[docs] - - - name: Build Sphinx documentation - shell: bash - run: | - python -m sphinx -T -b html -d _build/doctrees -D language=en docsrc docs_compiled - ls docs_compiled - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ inputs.github-token }} - publish_dir: ./docs_compiled - destination_dir: sdk_docs diff --git a/.gitignore b/.gitignore index 388483bc1a..2e08a3ef5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ docsrc/_build +docs/* +!docs/requirements.txt .idea