Skip to content

Integration Test

Integration Test #206

name: Integration Test
on:
workflow_dispatch:
inputs:
baseFolderPath:
description: 'Base folder path for diffs'
required: true
default: 'diffs'
dynamicCoordinates:
description: 'Array of booleans for dynamic coordinates (e.g., [true, false])'
required: true
default: '[true, false]'
doHarvest:
description: "Do harvest and verify completion"
required: false
default: 'true'
schedule:
- cron: '0 0 * * 6' # Every Saturday at midnight
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
dynamicCoordinates: ${{ fromJson(github.event.inputs.dynamicCoordinates || '[false]') }}
defaults:
run:
working-directory: ./tools/integration
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: 'npm'
cache-dependency-path: './tools/integration/'
- name: Install dependencies
run: npm ci
- name: Run tests on tools
run: npm test
- name: Check whether to run integration tests
if: ${{ github.event_name == 'schedule' && github.repository != 'clearlydefined/operations' }}
run: |
echo "Repository: ${{ github.repository }}, Event: ${{ github.event_name }}"
echo "Running scheduled integration tests only on clearlydefined/operations."
exit 1
- name: Trigger harvest and verify completion if required
if: ${{ github.event.inputs.doHarvest == 'true' || github.event.inputs.doHarvest == null || matrix.dynamicCoordinates == 'true' }}
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run e2e-test-harvest
- name: Verify service functions
id: verify-service-functions
continue-on-error: true
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run e2e-test-service
- name: Clean up
run: GITHUB_TOKEN=${{ secrets.CLEARLYDEFINED_GITHUB_PAT }} npm run e2e-test-service-cleanup
- name: Generate structured diffs
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run definitions-diff ${{ github.event.inputs.baseFolderPath || 'diffs' }}
- name: Upload diffs artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: diffs-${{ matrix.dynamicCoordinates == 'true' && 'dynamic' || 'static' }}
path: ./tools/integration/${{ github.event.inputs.baseFolderPath || 'diffs' }}
- name: Mark build status
if: steps.verify-service-functions.outcome == 'failure'
run: exit 1