Skip to content

Commit 89e0a16

Browse files
committed
clean: faster github actions
1 parent 6d015fa commit 89e0a16

File tree

7 files changed

+48
-77
lines changed

7 files changed

+48
-77
lines changed

.github/workflows/publish.docs.yml .github/workflows/docs.yml

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Publish (docs)
2+
name: Publish docs
33
on: # yamllint disable-line rule:truthy
44
workflow_dispatch:
55
push:
@@ -10,21 +10,15 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
publish:
13+
publish-docs:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
contents: write
1717
steps:
18-
- name: Checkout
19-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20-
- name: Setup Go
21-
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
18+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
2220
with:
23-
# renovate: datasource=golang-version
24-
go-version: 1.21.0
25-
cache-dependency-path: |
26-
**/go.sum
27-
**/go.mod
21+
go-version-file: "go.mod"
2822
- name: Generate cmd docs
2923
run: make docs
3024
- name: Run mkdocs

.github/workflows/lint.golang.yml

-27
This file was deleted.

.github/workflows/test.golang.yml .github/workflows/qa.yml

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,61 @@
11
---
2-
name: Test (Golang)
2+
name: QA
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
types: [opened, synchronize]
66
paths:
7-
- .github/workflows/test.golang.yml
8-
- go.*
9-
- cmd/**
10-
- pkg/**
7+
- ".github/workflows/qa.yml"
8+
- "go.*"
9+
- "**.go"
1110
push:
1211
branches: [main]
1312

1413
jobs:
15-
go-test:
16-
name: Golang test
14+
lint:
15+
name: Run lint
1716
runs-on: ubuntu-latest
1817
steps:
18+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1919
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
2020
with:
21-
# renovate: datasource=golang-version
22-
go-version: "1.21.0"
23-
check-latest: true
21+
go-version-file: "go.mod"
22+
23+
- name: Run linters
24+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
25+
with:
26+
# renovate: datasource=github-releases depName=golangci/golangci-lint
27+
version: v1.56.2
28+
29+
tests:
30+
name: Run tests
31+
runs-on: ubuntu-latest
32+
steps:
2433
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
34+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
35+
with:
36+
go-version-file: "go.mod"
2537
- uses: tlylt/install-graphviz@b2201200d85f06f0189cb74d9b69208504cf12cd # v1.0.0
2638

27-
- name: Run golang tests
39+
- name: Run tests
2840
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
2941
- name: Archive code coverage results
3042
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
3143
with:
32-
name: golang-coverage-report
44+
name: coverage-results
3345
path: coverage.out
3446
retention-days: 1
3547

3648
codecov:
37-
name: Codecov
49+
name: Upload coverage to Codecov
50+
needs: [tests]
3851
runs-on: ubuntu-latest
39-
needs: [go-test]
4052
steps:
4153
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4254
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
4355
with:
44-
name: golang-coverage-report
45-
46-
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
56+
name: coverage-results
57+
- name: Upload coverage to Codecov
58+
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
4759
with:
4860
token: ${{ secrets.CODECOV_TOKEN }}
4961
fail_ci_if_error: true

.github/workflows/release.goreleaser.yml .github/workflows/release.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Release (Goreleaser)
2+
name: Release
33
on: # yamllint disable-line rule:truthy
44
push:
55
tags: [v*]
@@ -8,17 +8,13 @@ jobs:
88
goreleaser:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
11+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1312
with:
1413
fetch-depth: 0
15-
- name: Set up Go
16-
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
14+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
1715
with:
18-
# renovate: datasource=golang-version
19-
go-version: "1.21.0"
20-
- name: Run GoReleaser
21-
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
16+
go-version-file: "go.mod"
17+
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
2218
with:
2319
distribution: goreleaser
2420
# renovate: datasource=github-tags depName=goreleaser/goreleaser

.github/workflows/lint.github-action.yml .github/workflows/security.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
---
2-
name: Lint (Github Actions workflows)
2+
name: Actions security
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
types: [opened, synchronize]
66
paths: [.github/workflows/**]
77

88
jobs:
9-
# CI harden security tries to keep your github actions secure by following these simple rules:
10-
# - Check if no issues are found on your Github Action
11-
# - Ensure that all action and reusable workflow are pinned using directly a commit SHA
12-
ci_harden_security:
13-
name: Github Action security hardening
9+
# Actions security tries to keep your GitHub actions secure by following these simple rules:
10+
# - Check if no issues are found on your GitHub Actions
11+
# - Ensure that all GitHub Actions and reusable workflow are pinned using directly a commit SHA
12+
actions_security:
1413
runs-on: ubuntu-latest
1514
permissions:
1615
security-events: write
1716
steps:
1817
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19-
20-
- name: Lint your Github Actions
18+
- name: Github Actions lint
2119
run: |
2220
curl -O https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
2321
echo "::add-matcher::.github/actionlint-matcher.json"
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
---
2-
name: Lint (YAML)
2+
name: YAML lint
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
types: [opened, synchronize]
66
paths: ["**.ya?ml"]
77

88
jobs:
9-
yamllint:
10-
name: YAML lint
9+
lintyaml:
1110
runs-on: ubuntu-latest
1211
steps:
1312
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
14-
1513
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # tag=v3.1.1
1614
with:
1715
format: github

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DIB: Docker Image Builder
22
=========================
33

44
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/radiofrance/dib?sort=semver)
5-
![CI Status](https://img.shields.io/github/actions/workflow/status/radiofrance/dib/ci.yml?label=CI&logo=github-actions&logoColor=fff)
5+
![CI Status](https://img.shields.io/github/actions/workflow/status/radiofrance/dib/qa.yml?label=QA&logo=github-actions&logoColor=fff)
66
[![codecov](https://codecov.io/gh/radiofrance/dib/branch/main/graph/badge.svg)](https://codecov.io/gh/radiofrance/dib)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/radiofrance/dib)](https://goreportcard.com/report/github.com/radiofrance/dib)
88

0 commit comments

Comments
 (0)