Skip to content

Release

Release #48

Workflow file for this run

name: Contract tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * *'
repository_dispatch:
types: [openapi-updated]
permissions:
contents: read
issues: write
jobs:
contract:
name: validate parser against latest audd-openapi fixtures
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: audd-php
- uses: actions/checkout@v4
with:
repository: AudDMusic/audd-openapi
path: audd-openapi
ref: main
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: composer:v2
- name: Composer install
working-directory: audd-php
run: composer install --prefer-dist --no-progress
- name: Run contract tests
working-directory: audd-php
env:
AUDD_OPENAPI_FIXTURES: ${{ github.workspace }}/audd-openapi/fixtures
run: composer test-contract
- name: Open issue on failure (dispatched runs only)
if: failure() && github.event_name == 'repository_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRIGGER_SHA: ${{ github.event.client_payload.trigger_sha }}
run: |
gh issue create \
--title "Contract drift: audd-openapi spec change broke parser" \
--body "An openapi-updated dispatch (trigger SHA: $TRIGGER_SHA) caused contract tests to fail." \
--label "contract-drift" || true