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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [main]
pull_request:
# Run every job regardless of what changed.
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -13,6 +15,46 @@ permissions:
contents: read

jobs:
# Which projects changed (whole PR vs its base; previous commit on main).
# The project jobs below only run when their files change; editing this
# workflow runs all of them.
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
api: ${{ steps.filter.outputs.api }}
dashboard: ${{ steps.filter.outputs.dashboard }}
consent-lib: ${{ steps.filter.outputs.consent-lib }}
docs: ${{ steps.filter.outputs.docs }}
server-image: ${{ steps.filter.outputs.server-image }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ci: &ci
- .github/workflows/ci.yml
api:
- *ci
- 'server/api/**'
dashboard:
- *ci
- 'server/dashboard/**'
consent-lib:
- *ci
- 'consent-lib/**'
docs:
- *ci
- 'docs/**'
server-image:
- *ci
- 'server/**'
- 'consent-lib/**'
- 'docker-bake.hcl'

# Formatting, markdown and links for the whole repository (root tooling).
repo:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,6 +89,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

api:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.api == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -79,6 +123,8 @@ jobs:
- run: npm run build

dashboard:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.dashboard == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -97,6 +143,8 @@ jobs:

# Lint + Karma in the Node 16 image (same as `npm run lib:check`).
consent-lib:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.consent-lib == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -109,6 +157,8 @@ jobs:
cache-to: type=gha,scope=consent-lib,mode=max

docs:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.docs == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -126,6 +176,8 @@ jobs:

# The production image (widget from consent-lib + dashboard + API); not pushed.
server-image:
needs: changes
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.server-image == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ consent-lib/packages/apicuron-consent-wc/manifest.json
.agents/skills/grill-me/
.agents/skills/grilling/
.claude/

# Written by release-please in its release PRs (no git hooks run there)
CHANGELOG.md
.release-please-manifest.json
Loading