Merge pull request #42 from root-signals/judge-create-endpoint #115
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
name: Validate and build | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ci-sdk-python: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.cache/uv | |
key: sdk-python-${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
sdk-python-${{ runner.os }}-python-${{ matrix.python-version }}- | |
- name: Setup | |
run: make .venv | |
- name: Ensure generated schema matches what we have | |
run: | | |
make generate-openapi-client | |
sudo chown -R `whoami` src/root/generated | |
make fix-openapi-client | |
git diff src/root/generated || \ | |
( echo "Generated OpenAPI has changed. Please run 'make generate' and commit the changes." && exit 1 ) | |
- name: Run the lint+tests | |
if: | | |
!(github.event_name == 'push' && github.ref_name == 'main') | |
run: make | |
- name: Build dist | |
if: | | |
!(github.event_name == 'push' && github.ref_name == 'main') | |
run: make dist | |
trigger-integration-tests: | |
needs: ci-sdk-python | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Trigger downstream workflow | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.WORKFLOW_PAT }} | |
repository: ${{ secrets.DOWNSTREAM_REPO }} | |
event-type: python-sdk-integration-tests | |
client-payload: | | |
{ | |
"ref": "${{ github.event.pull_request.head.sha }}", | |
"branch": "${{ github.event.pull_request.head.ref }}", | |
"pr_number": "${{ github.event.pull_request.number }}" | |
} |