Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Commits

on:
workflow_call:
inputs:
ref:
required: true
type: string

permissions:
contents: read

jobs:
lint-commits:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
name: Validate Commits

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Inspect Commits
uses: mridang/action-commit-lint@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/depcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependency Review

on:
pull_request:

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Review Dependencies
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
60 changes: 60 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Linting

on:
workflow_call:
inputs:
ref:
required: true
type: string
commit_changes:
required: false
type: boolean
default: false

defaults:
run:
working-directory: ./

permissions:
contents: read

jobs:
lint-format:
permissions:
contents: write
runs-on: ubuntu-latest
name: Reformat Code

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm ci --no-progress

- name: Run Formatter
run: npm run format

- name: Commit Changes
if: ${{ inputs.commit_changes == true }}
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
with:
commit_message: 'style: Apply automated code formatting [skip ci]'
commit_options: '--no-verify'
repository: .
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
66 changes: 66 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Pipeline

on:
push:

permissions:
contents: write
actions: read
checks: write
pull-requests: write

jobs:
lint-commits:
name: Run Commitlint Checks
if: github.event_name == 'pull_request'
uses: ./.github/workflows/commitlint.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
secrets: inherit

code-style:
name: Run Linter Formatter
uses: ./.github/workflows/linting.yml
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
commit_changes: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
secrets: inherit

type-check:
name: Run Type Checks
uses: ./.github/workflows/typecheck.yml
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
secrets: inherit

run-tests:
name: Run Test Suite
uses: ./.github/workflows/test.yml
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
secrets: inherit

check-deps:
name: Run Dependency Checks
uses: ./.github/workflows/unused.yml
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
secrets: inherit

all-passed:
name: Check Build Status
runs-on: ubuntu-latest
needs:
- lint-commits
- code-style
- type-check
- run-tests
- check-deps
steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Report Success
run: echo "All required checks passed successfully."
41 changes: 41 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Scorecard Analysis

on:
push:
branches:
- main

permissions:
contents: read

jobs:
scorecard_analysis:
name: Scorecard Analysis
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
id-token: write

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Run Checks
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: Upload Results
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
sarif_file: results.sarif
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Testing

on:
workflow_call:
inputs:
ref:
required: true
type: string

defaults:
run:
working-directory: ./

jobs:
app-testing:
runs-on: ubuntu-latest
name: Run Tests

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm ci --no-progress

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Run Tests
run: npm run test

- name: Upload Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: test-results
path: build/reports/**/*.xml

- name: Generate Report
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
uses: dorny/test-reporter@6e6a65b7a0bd2c9197df7d0ae36ac5cee784230c # v2.0.0
with:
name: Tests
path: build/reports/**/*.xml
reporter: java-junit
fail-on-error: 'false'
token: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Typecheck

on:
workflow_call:
inputs:
ref:
required: true
type: string

defaults:
run:
working-directory: ./

permissions:
contents: read

jobs:
tsc-check:
runs-on: ubuntu-latest
name: Inspect Code

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm ci --no-progress

- name: Run Typecheck
run: npm run prepack
42 changes: 42 additions & 0 deletions .github/workflows/unused.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Dependencies

on:
workflow_call:
inputs:
ref:
required: true
type: string

permissions:
contents: read

jobs:
lint-dependencies:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
name: Lint Dependencies

steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm ci --no-progress

- name: Inspect Dependencies
uses: mridang/action-dependency-insight@v1
Loading