Skip to content

Commit

Permalink
chore: refactor into reusable workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Mar 8, 2024
1 parent a3f7bca commit 12ac468
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 19 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_call: {}
workflow_dispatch: {}

permissions:
contents: read
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
name: "CodeQL"

on:
workflow_call: {}
workflow_dispatch: {}
push:
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
schedule:
- cron: "0 0 * * 1"

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: 'Dependency Graph'
on:
pull_request: {}
push:
branches:
- master
workflow_call: { }
workflow_dispatch: { }

permissions:
contents: read
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: "Validate Gradle Wrapper"
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_call: {}
workflow_dispatch: {}

permissions:
contents: read
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR

on:
pull_request:
branches:
- master

permissions:
contents: read

jobs:
## Run main CI build and tests.
run-ci:
name: "Build & Test"
uses: ./.github/workflows/ci.yml
permissions:
actions: write
contents: write

## Validate the Gradle Wrapper binary
checks-gradle-wrapper:
name: "Checks"
uses: ./.github/workflows/gradle-wrapper-validation.yml

## Publish and check the dependency graph.
checks-dependency-graph:
name: "Checks"
uses: ./.github/workflows/dependency-review.yml
permissions:
id-token: write

## Run CodeQL checks
checks-codeql:
name: "Checks"
uses: ./.github/workflows/codeql.yml
25 changes: 25 additions & 0 deletions .github/workflows/on.push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push

on:
push:
branches:
- master

permissions:
contents: read

jobs:
## Run main CI build and tests.
run-ci:
name: "Build & Test"
uses: ./.github/workflows/ci.yml
permissions:
actions: write
contents: write

## Publish and check the dependency graph.
checks-dependency-graph:
name: "Checks"
uses: ./.github/workflows/dependency-review.yml
permissions:
id-token: write

0 comments on commit 12ac468

Please sign in to comment.