Skip to content

Update testing-library monorepo to v14.6.3 (#207) #398

Update testing-library monorepo to v14.6.3 (#207)

Update testing-library monorepo to v14.6.3 (#207) #398

Workflow file for this run

name: CI with Specmatic Mocks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
CTRF_REPORT_PATH: './build/reports/specmatic/stub/ctrf/*.json'
steps:
- uses: actions/checkout@v6
- name: Set up JRE 17
uses: actions/setup-java@v5
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
java-package: 'jre'
- name: Use Node.js 25
uses: actions/setup-node@v6
with:
node-version: 25
- name: npm install
run: npm ci
- name: Save Specmatic license
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
mkdir -p ~/.specmatic
echo "${{ secrets.SPECMATIC_LICENSE_KEY }}" > ~/.specmatic/specmatic-license.txt
- name: Run UI Component Test
run: npm test -- --watchAll=false
- name: Sleep for 10 seconds
run: sleep 10
- name: Upload Stub CTRF Report
uses: actions/upload-artifact@v6
if: always() # Run even if tests fail
with:
name: ctrf-report
path: ${{ env.CTRF_REPORT_PATH }}
retention-days: 5
# Display CTRF test results
- name: Publish Stub Results
uses: ctrf-io/github-test-reporter@v1
if: always() # Run even if tests fail
with:
report-path: ${{ env.CTRF_REPORT_PATH }}
- name: Publish Build Report to Specmatic Insights
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
docker run \
--rm \
-e GIT_DISCOVERY_ACROSS_FILESYSTEM=1 \
-e GIT_CONFIG_COUNT=1 \
-e GIT_CONFIG_KEY_0=safe.directory \
-e GIT_CONFIG_VALUE_0=/usr/src/app \
-v "${HOME}/.specmatic:/root/.specmatic:ro" \
-v "${{ github.workspace }}:/usr/src/app" \
-w /usr/src/app \
specmatic/specmatic \
send-report \
--metadata build_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \
--branch-name ${{ github.ref_name }} \
--repo-name ${{ github.event.repository.name }} \
--repo-id ${{ github.repository_id }} \
--repo-url ${{ github.event.repository.html_url }}