Skip to content

Add mutation testing as part of ci pipeline. #97

Add mutation testing as part of ci pipeline.

Add mutation testing as part of ci pipeline. #97

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '21'
distribution: 'temurin'
# Verify gradle-wrapper.jar matches a known-good Gradle release checksum before it
# is executed — guards against a tampered wrapper jar (a classic build-time backdoor).
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6
- name: Set up Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6
- name: Build and test
run: ./gradlew clean build test --stacktrace
- name: Upload JaCoCo reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: jacoco-reports
path: '**/build/reports/jacoco/**'
if-no-files-found: ignore
# Run mutation tests and output mutation testing artifact report
# In the future, consider:
# Stryker has a free hosted dashboard at stryker-mutator.io that tracks mutation score over time with a badge.
# Requires adding STRYKER_DASHBOARD_API_KEY as a repo secret and adding "dashboard" to reporters in
# stryker.config.mjs.
# The job then passes --dashboard.module passkeys-browser to distinguish it.
#
browser-mutation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
working-directory: clients/passkeys-browser
- name: Run Stryker mutation tests
run: npx stryker run
working-directory: clients/passkeys-browser
- name: Upload mutation report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: mutation-report
path: clients/passkeys-browser/reports/mutation/
if-no-files-found: ignore
# Block PRs that introduce dependencies with known vulnerabilities or incompatible
# licenses, before they merge. Uses the GitHub dependency graph; PR-only.
dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Dependency review
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: high