Skip to content

Commit 07115d4

Browse files
committed
ci: Refactor workflow names and events
Signed-off-by: robot9001 <robo9k@symlink.io>
1 parent 77d8e24 commit 07115d4

8 files changed

+36
-25
lines changed

.github/workflows/build.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: build
1+
name: "build"
22

33
permissions: {}
44

55
on:
6+
# run "test" job on push events as well to get main branch coverage
67
push:
78
branches: [ main ]
89
pull_request:
9-
branches: [ main ]
1010

1111
env:
1212
CARGO_TERM_COLOR: always
1313

1414
jobs:
1515
build:
16+
name: "cargo build"
17+
if: github.event_name == 'pull_request'
1618
permissions:
1719
contents: read
1820
runs-on: ubuntu-22.04
@@ -36,7 +38,7 @@ jobs:
3638
- run: cargo +${{ steps.toolchain.outputs.name }} build --all-targets --all-features --verbose
3739

3840
test:
39-
name: "test (with coverage)"
41+
name: "cargo test (with coverage)"
4042
permissions:
4143
contents: read
4244
runs-on: ubuntu-22.04
@@ -81,7 +83,8 @@ jobs:
8183
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8284

8385
test-careful:
84-
name: "test (carefully)"
86+
if: github.event_name == 'pull_request'
87+
name: "cargo test (carefully)"
8588
permissions:
8689
contents: read
8790
runs-on: ubuntu-22.04

.github/workflows/conventional-commits.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
name: cog check
1+
name: "conventional commits"
22

33
permissions: {}
44

55
on:
6-
pull_request:
7-
branches: [ main ]
6+
pull_request:
87

98
jobs:
10-
check-conventional-commits:
11-
name: check conventional commit compliance
9+
cog-check:
10+
name: "cog check"
1211
permissions:
1312
contents: read
1413
runs-on: ubuntu-22.04
@@ -17,7 +16,7 @@ jobs:
1716
with:
1817
egress-policy: audit
1918

20-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
19+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
2120
with:
2221
fetch-depth: 0
2322
# pick the pr HEAD instead of the merge commit

.github/workflows/deny.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: cargo deny
1+
name: "deny"
22

33
permissions: {}
44

@@ -10,6 +10,7 @@ env:
1010

1111
jobs:
1212
cargo-deny:
13+
name: "cargo deny"
1314
permissions:
1415
contents: read
1516
runs-on: ubuntu-22.04

.github/workflows/docs.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
name: docs
1+
name: "docs"
22

33
permissions: {}
44

55
on:
66
pull_request:
7+
# run "deploy-pages" job to deploy main branch to GitHub pages
78
push:
8-
branches:
9-
- main
9+
branches: [ "main" ]
1010

1111
jobs:
1212
build-rustdoc:
13+
name: "cargo doc"
1314
permissions:
1415
contents: read
1516
runs-on: ubuntu-22.04
@@ -42,6 +43,7 @@ jobs:
4243
path: target/doc/
4344

4445
deploy-pages:
46+
name: "deploy GitHub pages"
4547
if: github.event_name == 'push'
4648
permissions:
4749
id-token: write

.github/workflows/lint.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: lint
1+
name: "lint"
22

33
permissions: {}
44

55
on:
66
pull_request:
7-
branches: [ main ]
87

98
env:
109
RUSTFLAGS: -Dwarnings
1110

1211
jobs:
1312
cargo-fmt:
13+
name: "cargo fmt"
1414
permissions:
1515
contents: read
1616
runs-on: ubuntu-22.04
@@ -30,6 +30,7 @@ jobs:
3030
- run: cargo +${{ steps.toolchain.outputs.name }} fmt --all --check
3131

3232
cargo-clippy:
33+
name: "cargo clippy"
3334
permissions:
3435
contents: read
3536
runs-on: ubuntu-22.04
@@ -49,6 +50,7 @@ jobs:
4950
- run: cargo +${{ steps.toolchain.outputs.name }} clippy --all-targets --all-features
5051

5152
cargo-rustdoc-clippy:
53+
name: "cargo rustdoc-clippy"
5254
permissions:
5355
contents: read
5456
runs-on: ubuntu-22.04

.github/workflows/release.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
name: release-plz
1+
name: "release-plz"
22

33
permissions: {}
44

55
on:
66
push:
7-
branches:
8-
- main
7+
branches: [ "main" ]
98

109
jobs:
1110
release-plz:

.github/workflows/reuse.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
name: REUSE compliance check
1+
name: "REUSE"
22

33
permissions: {}
44

5-
on: [push, pull_request]
5+
on:
6+
# also run on push to main branch for badge
7+
push:
8+
branches: [ main ]
9+
pull_request:
610

711
jobs:
8-
test:
12+
lint:
13+
name: "reuse lint"
914
permissions:
1015
contents: read
1116
runs-on: ubuntu-latest
1217
steps:
1318
- uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
1419
with:
1520
egress-policy: audit
16-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
21+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
1722
- name: REUSE Compliance Check
1823
uses: fsfe/reuse-action@4f2804894b54004c8ed4b8a62b7c649e54a3aa4b # v2.0.0

.github/workflows/scorecards.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Scorecards supply-chain security
1+
name: "scorecards"
22

33
permissions: read-all
44

@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
analysis:
14-
name: Scorecards analysis
14+
name: "scorecards analysis"
1515
runs-on: ubuntu-latest
1616
permissions:
1717
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results

0 commit comments

Comments
 (0)