Skip to content

Commit

Permalink
Merge pull request #103 from clearlydefined/roman/it
Browse files Browse the repository at this point in the history
Use user input to drive integration tests action
  • Loading branch information
RomanIakovlev authored Oct 21, 2024
2 parents 0c8eefb + 2dd999e commit e10e5ab
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ name: Integration Test
on:
workflow_dispatch:
inputs:
runType:
type: choice
description: To run tests with dynamic or fixed coordinates or both
options:
- dynamic
- fixed
- all
required: true

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]'

permissions:
contents: read
Expand All @@ -25,6 +20,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
dynamicCoordinates: ${{ fromJson(github.event.inputs.dynamicCoordinates) }}
defaults:
run:
working-directory: ./tools/integration
Expand All @@ -44,18 +41,22 @@ jobs:
run: npm test

- name: Trigger harvest and verify completion
if: ${{ inputs.runType == 'dynamic' || 'all' }}
run: DYNAMIC_COORDINATES=true npm run e2e-test-harvest
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run e2e-test-harvest

- name: Verify service functions
if: ${{ inputs.runType == 'fixed' || 'all' }}
run: DYNAMIC_COORDINATES=false npm run e2e-test-service
id: verify-service-functions
continue-on-error: true
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run e2e-test-service

- name: Generate structured diffs
run: npm run definitions-diff ${{ github.event.inputs.baseFolderPath }}
run: DYNAMIC_COORDINATES=${{ matrix.dynamicCoordinates }} npm run definitions-diff ${{ github.event.inputs.baseFolderPath }}

- name: Upload diffs artifact
uses: actions/upload-artifact@v4
with:
name: diffs-${{ matrix.dynamicCoordinates == 'true' && 'dynamic' || 'static' }}
path: ${{ github.event.inputs.baseFolderPath }}
path: ./tools/integration/${{ github.event.inputs.baseFolderPath }}

- name: Mark build status
if: steps.verify-service-functions.outcome == 'failure'
run: exit 1

0 comments on commit e10e5ab

Please sign in to comment.