Skip to content

[pre-commit.ci] pre-commit autoupdate #265

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #265

---
name: API Gateway integration tests
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
jobs:
setup-gateway:
runs-on: ubuntu-22.04
container: python:3.11-bookworm
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
- name: Deploy Serverless Gateway
run: poetry run scwgw infra deploy
env:
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
run-tests:
needs:
- setup-gateway
runs-on: ubuntu-22.04
container: python:3.11-bookworm
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
- name: Run integration tests
working-directory: tests
run: |
poetry run scwgw infra config
poetry run pytest integrations/gateway -n $(nproc --all)
env:
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
teardown-gateway:
runs-on: ubuntu-22.04
container: python:3.11-bookworm
needs:
- run-tests
# Tolerate errors if no resources found to clean up
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
- name: Delete Serverless Gateway
run: poetry run scwgw infra delete -y
env:
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}