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
2 changes: 0 additions & 2 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ reviews:
- ".*"
ignore_usernames:
- "dependabot[bot]"
ignore_title_keywords:
- WIP

path_filters:
- "!**/node_modules/**"
Expand Down
53 changes: 53 additions & 0 deletions .github/actions/changed-stacks/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Changed stacks
description: >
Report whether a pull request touches the C# or Vue stack, so workflows can
skip jobs for the stack it leaves alone. Non-PR events report both as changed.
Needs a checkout with fetch-depth 0.

inputs:
own-paths:
description: The calling workflow's own files or folders, space-separated; a change to any runs both stacks.
required: true

outputs:
csharp:
description: "'true' when C# code or its build/tooling changed"
value: ${{ steps.filter.outputs.csharp }}
vue:
description: "'true' when Vue code or its build/tooling changed"
value: ${{ steps.filter.outputs.vue }}

runs:
using: composite
steps:
- id: filter
shell: bash
env:
BASE_REF: ${{ github.base_ref }}
OWN_PATHS: ${{ inputs.own-paths }}
run: |
if [ -z "$BASE_REF" ]; then
echo "csharp=true" >> "$GITHUB_OUTPUT"
echo "vue=true" >> "$GITHUB_OUTPUT"
exit 0
fi

files=$(git -c core.quotePath=false diff --no-renames --name-only "origin/$BASE_REF...HEAD")
echo "Changed files:"
echo "$files"

# Shared tooling runs both stacks; other workflow files run neither
shared="^(package(-lock)?\.json$|scripts/|\.editorconfig$|\.jscpd\.json$|\.npmrc$|\.github/actions/changed-stacks/)"
dot='\.'
for p in $OWN_PATHS; do shared="$shared|^${p//./$dot}"; done
csharp="$shared|^(web/|test/|Viper\.sln|Directory\.Build\.props$|global\.json$|\.globalconfig$|\.config/)"
vue="$shared|^(VueApp/|eslint\.config\.mjs$|\.oxlintrc\.json$|stylelint\.config\.mjs$|\.env)"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

for stack in csharp vue; do
if grep -qE "${!stack}" <<< "$files"; then
echo "$stack=true" >> "$GITHUB_OUTPUT"
else
echo "$stack=false" >> "$GITHUB_OUTPUT"
fi
done
cat "$GITHUB_OUTPUT"
27 changes: 26 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Code Quality

on:
pull_request:
branches: [main]

# Detects whether a PR *adds* new dead code or duplication compared to main.
# - fallow covers VueApp (dead code, unused exports, complexity, duplication)
Expand All @@ -13,8 +12,28 @@ on:
# Passes if counts are equal to or lower than main.

jobs:
changes:
name: Detect changed stacks
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
csharp: ${{ steps.stacks.outputs.csharp }}
vue: ${{ steps.stacks.outputs.vue }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
persist-credentials: false
- id: stacks
uses: ./.github/actions/changed-stacks
with:
own-paths: .github/workflows/code-quality.yml

fallow-regression:
name: Fallow regression (VueApp)
needs: changes
if: needs.changes.outputs.vue == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout PR head
Expand Down Expand Up @@ -64,6 +83,8 @@ jobs:

jscpd-regression-csharp:
name: JSCPD regression (C#/Razor)
needs: changes
if: needs.changes.outputs.csharp == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout PR head
Expand Down Expand Up @@ -100,6 +121,8 @@ jobs:

jscpd-regression-vue:
name: JSCPD regression (Vue/TS)
needs: changes
if: needs.changes.outputs.vue == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout PR head
Expand Down Expand Up @@ -133,6 +156,8 @@ jobs:

resharper-pr-gate:
name: ReSharper PR-scoped gate (C#)
needs: changes
if: needs.changes.outputs.csharp == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout PR head
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,31 @@ on:
- cron: '32 18 * * 6'

jobs:
changes:
name: Detect changed stacks
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
csharp: ${{ steps.stacks.outputs.csharp }}
vue: ${{ steps.stacks.outputs.vue }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- id: stacks
uses: ./.github/actions/changed-stacks
with:
own-paths: .github/workflows/codeql.yml .github/codeql/

analyze:
name: Analyze
needs: changes
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
# Job-level `if` can't read the matrix; web/ holds plain JS, so a C# change runs both
env:
RUN_ANALYSIS: ${{ needs.changes.outputs.csharp == 'true' || (matrix.language == 'javascript' && needs.changes.outputs.vue == 'true') }}
permissions:
actions: read
contents: read
Expand All @@ -40,10 +62,12 @@ jobs:

steps:
- name: Checkout repository
if: env.RUN_ANALYSIS == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
if: env.RUN_ANALYSIS == 'true'
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
Expand All @@ -52,6 +76,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
if: env.RUN_ANALYSIS == 'true'
uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1

# ℹ️ Command-line programs to run using the OS shell.
Expand All @@ -65,6 +90,7 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
if: env.RUN_ANALYSIS == 'true'
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/development-merge-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: Development Merge Check
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
Comment thread
rlorenzo marked this conversation as resolved.
Resolved
branches: [main]
branches-ignore: [Development]
push:
branches: [Development]
workflow_dispatch:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
// in Development without a new PR commit. Re-run each still-red PR's
// check so its verdict refreshes against the updated Development.
const prs = await github.paginate(github.rest.pulls.list, {
owner, repo, state: 'open', base: 'main', per_page: 100,
owner, repo, state: 'open', per_page: 100,
});
const runs = await github.paginate(github.rest.actions.listWorkflowRuns, {
owner, repo, workflow_id: WORKFLOW, event: 'pull_request', per_page: 100,
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,30 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
changes:
name: Detect changed stacks
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
csharp: ${{ steps.stacks.outputs.csharp }}
vue: ${{ steps.stacks.outputs.vue }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- id: stacks
uses: ./.github/actions/changed-stacks
with:
own-paths: .github/workflows/tests.yml

frontend:
name: Frontend Tests
needs: changes
if: needs.changes.outputs.vue == 'true'
runs-on: ubuntu-latest
env:
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
Expand Down Expand Up @@ -54,6 +73,8 @@ jobs:

backend:
name: Backend Tests
needs: changes
if: needs.changes.outputs.csharp == 'true'
runs-on: ubuntu-latest
env:
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
Expand Down
Loading