Revert "Fixes #265 with Thread-Aware Message Retrieval" (#270) #128
This file contains hidden or 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
| # Live workflow. Legacy token-keeper snapshot: docs/ci/legacy/build-and-test.token-keeper.yml | |
| name: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 13 * * 1" | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| environment: webex-ci | |
| env: | |
| POETRY_VIRTUALENVS_CREATE: false | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: Gr1N/setup-poetry@v9 | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Install Dependencies | |
| run: | | |
| poetry self add "poetry-dynamic-versioning[plugin]" | |
| poetry install --no-root --only=dev | |
| - name: Get Webex access token | |
| id: webex_token | |
| env: | |
| WEBEX_ACCESS_TOKEN_STATIC: ${{ secrets.WEBEX_ACCESS_TOKEN }} | |
| WEBEX_CLIENT_ID: ${{ secrets.WEBEX_CLIENT_ID }} | |
| WEBEX_CLIENT_SECRET: ${{ secrets.WEBEX_CLIENT_SECRET }} | |
| WEBEX_REFRESH_TOKEN: ${{ secrets.WEBEX_REFRESH_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| if [ -n "${WEBEX_ACCESS_TOKEN_STATIC:-}" ]; then | |
| echo "WEBEX_ACCESS_TOKEN=$WEBEX_ACCESS_TOKEN_STATIC" >> "$GITHUB_OUTPUT" | |
| echo "::add-mask::$WEBEX_ACCESS_TOKEN_STATIC" | |
| exit 0 | |
| fi | |
| RESPONSE=$(curl -sS -X POST https://webexapis.com/v1/access_token \ | |
| -H "Content-Type: application/x-www-form-urlencoded" \ | |
| --data-urlencode "grant_type=refresh_token" \ | |
| --data-urlencode "client_id=${WEBEX_CLIENT_ID}" \ | |
| --data-urlencode "client_secret=${WEBEX_CLIENT_SECRET}" \ | |
| --data-urlencode "refresh_token=${WEBEX_REFRESH_TOKEN}") | |
| WEBEX_ACCESS_TOKEN=$(echo "$RESPONSE" | jq -r .access_token) | |
| if [ "$WEBEX_ACCESS_TOKEN" = "null" ] || [ -z "$WEBEX_ACCESS_TOKEN" ]; then | |
| echo "::error::Token refresh failed (no access_token in response)." | |
| exit 1 | |
| fi | |
| echo "WEBEX_ACCESS_TOKEN=$WEBEX_ACCESS_TOKEN" >> "$GITHUB_OUTPUT" | |
| echo "::add-mask::$WEBEX_ACCESS_TOKEN" | |
| - name: Build | |
| run: poetry build | |
| - name: Install | |
| run: pip install dist/*.whl | |
| - name: Test | |
| run: pytest -s -m "not slow and not manual" | |
| env: | |
| WEBEX_ACCESS_TOKEN: ${{ steps.webex_token.outputs.WEBEX_ACCESS_TOKEN }} | |
| WEBEX_TEST_DOMAIN: ${{ vars.WEBEX_TEST_DOMAIN }} | |
| WEBEX_TEST_ID_START: ${{ vars.WEBEX_TEST_ID_START }} | |
| WEBEX_TEST_FILE_URL: ${{ vars.WEBEX_TEST_FILE_URL }} | |
| WEBEX_GUEST_ISSUER_ID: ${{ secrets.WEBEX_GUEST_ISSUER_ID }} | |
| WEBEX_GUEST_ISSUER_SECRET: ${{ secrets.WEBEX_GUEST_ISSUER_SECRET }} | |
| - name: Upload Distribution Files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: distribution-files | |
| path: dist/ |