Skip to content
Merged
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
29 changes: 22 additions & 7 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: lint-and-test

on:
merge_group:
types: [checks_requested]
workflow_dispatch:

env:
Expand All @@ -12,20 +14,24 @@ jobs:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
services: ${{ steps.changes.outputs.services }}
libs: ${{ steps.changes.outputs.libs }}
frontend: ${{ steps.changes.outputs.frontend }}
infrastructure: ${{ steps.changes.outputs.infrastructure }}
services: ${{ steps.filter.outputs.services || steps.manual.outputs.services }}
libs: ${{ steps.filter.outputs.libs || steps.manual.outputs.libs }}
frontend: ${{ steps.filter.outputs.frontend || steps.manual.outputs.frontend }}
infrastructure: ${{ steps.filter.outputs.infrastructure || steps.manual.outputs.infrastructure }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changes
id: changes
# When running via merge queue, diff the merge-group head vs its base
- name: Detect changes (merge queue)
id: filter
if: github.event_name == 'merge_group'
uses: dorny/paths-filter@v3
with:
base: ${{ github.event.merge_group.base_sha }}
ref: ${{ github.event.merge_group.head_sha }}
filters: |
services:
- 'services/admin-backend/**'
Expand All @@ -40,6 +46,16 @@ jobs:
- 'infrastructure/**'
- 'Tiltfile'

# When run manually, just run everything
- name: Mark all as changed (manual run)
id: manual
if: github.event_name == 'workflow_dispatch'
run: |
echo "services=true" >> "$GITHUB_OUTPUT"
echo "libs=true" >> "$GITHUB_OUTPUT"
echo "frontend=true" >> "$GITHUB_OUTPUT"
echo "infrastructure=true" >> "$GITHUB_OUTPUT"

sanitize-branch-name:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -111,7 +127,6 @@ jobs:
run: |
docker build -t $LINT_IMAGE_NAME --build-arg DIRECTORY=${{ matrix.library }} --build-arg TEST=0 -f libs/Dockerfile libs


- name: Run linting
run: |
docker run --rm $LINT_IMAGE_NAME make lint
Expand Down