From 6cd1696da0dc8fe63a506a28382922b80a1aaa13 Mon Sep 17 00:00:00 2001 From: Adrian Kunz Date: Fri, 13 Oct 2023 20:36:09 +0200 Subject: [PATCH] ci: Separate CodeQL jobs depending on changed paths --- ...codeql-analysis.yml => codeql-backend.yml} | 34 +++++++---------- .github/workflows/codeql-frontend.yml | 37 +++++++++++++++++++ .github/workflows/codeql-services.yml | 37 +++++++++++++++++++ 3 files changed, 87 insertions(+), 21 deletions(-) rename .github/workflows/{codeql-analysis.yml => codeql-backend.yml} (55%) create mode 100644 .github/workflows/codeql-frontend.yml create mode 100644 .github/workflows/codeql-services.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-backend.yml similarity index 55% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql-backend.yml index d2a91f162..60be97e28 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-backend.yml @@ -1,33 +1,24 @@ -name: "CodeQL" +name: CodeQL Backend on: push: - branches: [ master, develop ] + branches: + - master + paths: + - backend/** pull_request: - branches: [ master, develop ] + branches: + - master + paths: + - backend/** jobs: - analyze-js: - name: Analyze JavaScript - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: javascript - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 analyze-java: name: Analyze Java runs-on: ubuntu-latest + defaults: + run: + working-directory: backend/ permissions: actions: read contents: read @@ -39,6 +30,7 @@ jobs: uses: github/codeql-action/init@v2 with: languages: java + source-root: backend/ - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/codeql-frontend.yml b/.github/workflows/codeql-frontend.yml new file mode 100644 index 000000000..f48e7d3c2 --- /dev/null +++ b/.github/workflows/codeql-frontend.yml @@ -0,0 +1,37 @@ +name: CodeQL Frontend + +on: + push: + branches: + - master + paths: + - frontend/** + pull_request: + branches: + - master + paths: + - frontend/** + +jobs: + analyze-js: + name: Analyze JavaScript + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend/ + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: javascript + source-root: frontend/ + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/codeql-services.yml b/.github/workflows/codeql-services.yml new file mode 100644 index 000000000..3d686d8cc --- /dev/null +++ b/.github/workflows/codeql-services.yml @@ -0,0 +1,37 @@ +name: CodeQL Services + +on: + push: + branches: + - master + paths: + - services/** + pull_request: + branches: + - master + paths: + - services/** + +jobs: + analyze-js: + name: Analyze JavaScript + runs-on: ubuntu-latest + defaults: + run: + working-directory: services/ + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: javascript + source-root: services/ + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2