Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up workflows to have successive steps #681

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: build-ci-images
name: build-images

on:
pull_request:
workflow_call:

jobs:
build-image:

build-images:
name: Build the images
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
name: lint

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

permissions: read-all

jobs:
golangci:
name: lint
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pull-request

on:
pull_request:

jobs:
lint:
uses: ./.github/workflows/lint.yml
tests:
needs: lint
uses: ./.github/workflows/tests.yml
build-images:
needs: [lint, tests]
uses: ./.github/workflows/build-images.yml
11 changes: 9 additions & 2 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: push-ci-images
name: push-main

on:
workflow_dispatch:
Expand All @@ -7,7 +7,14 @@ on:
- master

jobs:
build-push-image:
lint:
uses: ./.github/workflows/lint.yml
tests:
needs: lint
uses: ./.github/workflows/tests.yml

build-push-images:
name: Build and Push latest images
permissions:
contents: read
id-token: write
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ permissions:
id-token: write # needed for keyless signing

jobs:
lint:
uses: ./.github/workflows/lint.yml
tests:
needs: lint
uses: ./.github/workflows/tests.yml

release:
name: Create a release
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
tag_name: ${{ steps.tag.outputs.tag_name }}
Expand Down Expand Up @@ -87,6 +94,7 @@ jobs:
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"

provenance:
name: Set up the provenance
needs: [release]
permissions:
actions: read # To read the workflow path.
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: tests

on:
push:
branches:
- master
pull_request:
workflow_call:

jobs:
unit-tests:
tests:
name: Run unit tests
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion docs/outputs/pagerduty.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

| Setting | Env var | Default value | Description |
| --------------------------- | --------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `pagerduty.routingkey` | `PAGERDUTY_APIKEY` | | Pagerduty Routing Key, if not empty, Pagerduty output is **enabled** |
| `pagerduty.routingkey` | `PAGERDUTY_ROUTINGKEY` | | Pagerduty Routing Key, if not empty, Pagerduty output is **enabled** |
| `pagerduty.region` | `PAGERDUTY_REGION` | `us` | Pagerduty Region (`us`, `eu`) |
| `pagerduty.minimumpriority` | `PAGERDUTY_MINIMUMPRIORITY` | `""` (= `debug`) | Minimum priority of event for using this output, order is `emergency,alert,critical,error,warning,notice,informational,debug or ""` |

Expand Down
Loading