Skip to content

Build and Test

Build and Test #28

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: chris-1xrn.wbx.ai
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 Token
id: webex_token
run: |
WEBEX_ACCESS_TOKEN=$(curl -s ${{ secrets.WEBEX_TOKEN_KEEPER_URL }} | jq -r .access_token)
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/