refactor(ci): reduce complexity in required workflows (#3925)

* refactor(ci): builds upon work in tests to reduce complexity in requiring workflows

* fix: tweaks and missing outputs

* fix: make sure the new workflows actually run

* fix: consistency with non-required testing image
This commit is contained in:
Dylan Page
2023-11-05 21:41:32 -05:00
committed by GitHub
parent 9c6b8d0a96
commit 886dd96299
12 changed files with 174 additions and 188 deletions

View File

@@ -13,10 +13,9 @@ name: "CodeQL"
on:
push:
branches: [ "main" ]
paths:
- '**.go'
- '**.js'
branches:
- 'main'
- 'releases-**'
pull_request:
# The branches below must be a subset of the branches above
types:
@@ -24,19 +23,34 @@ on:
- reopened
- synchronize
- ready_for_review
branches: [ "main" ]
paths:
- '**.go'
- '**.js'
branches:
- 'main'
- 'releases-**'
schedule:
- cron: '17 9 * * 5'
jobs:
analyze:
name: Analyze
changes:
outputs:
should-run-analyze: ${{ steps.changes.outputs.src == 'true' }}
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- '**.go'
- '**.js4'
analyze:
needs: [changes]
name: Analyze
if: github.event.pull_request.draft == false && needs.changes.outputs.should-run-analyze == 'true'
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
@@ -87,3 +101,14 @@ jobs:
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
skip-analyze:
needs: [changes]
if: needs.changes.outputs.should-run-analyze == 'false'
name: Analyze
strategy:
matrix:
language: [ 'go', 'javascript' ]
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'