This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
ci: Generate code #2805
Workflow file for this run
This file contains 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
# Generated by seam-plop | |
name: Python Test | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
sdkSha: | |
description: "SHA of the seamapi-python commit to run against" | |
type: string | |
required: false | |
connectSha: | |
description: "SHA of the seam-connect commit to run against" | |
type: string | |
required: false | |
prRepo: | |
description: "Repository of PR context (needed when leaving comments)" | |
type: string | |
required: false | |
prNumber: | |
description: "PR number (needed when leaving comments)" | |
type: string | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
CONTAINER_REGISTRY: "ghcr.io" | |
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
steps: | |
- uses: Sibz/github-status-action@v1 | |
if: ${{ github.event.inputs.connectSha }} | |
with: | |
authToken: ${{ secrets.BOT_GH_TOKEN }} | |
context: Test Python SDK | |
state: pending | |
sha: ${{ github.event.inputs.connectSha }} | |
repository: seam-connect | |
target_url: ${{ env.RUN_URL }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.sdkSha }} | |
- name: Login to container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.CONTAINER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.BOT_GH_TOKEN }} | |
- name: Pre-pull Seam Connect image | |
run: | | |
docker pull ${{ env.CONTAINER_REGISTRY }}/seamapi/seam-connect:${{ github.event.inputs.connectSha || 'latest' }} | |
docker tag ${{ env.CONTAINER_REGISTRY }}/seamapi/seam-connect:${{ github.event.inputs.connectSha || 'latest' }} seamapi/seam-connect | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- run: poetry install | |
- run: poetry run pytest -s | |
env: | |
TC_HOST: 172.17.0.1 | |
- name: Send back status | |
uses: Sibz/github-status-action@v1 | |
if: ${{ github.event.inputs.connectSha && always() }} | |
with: | |
authToken: ${{ secrets.BOT_GH_TOKEN }} | |
context: Test Python SDK | |
state: ${{ job.status }} | |
sha: ${{ github.event.inputs.connectSha }} | |
repository: seam-connect | |
target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |