Skip to content

Commit b5a6d95

Browse files
committed
ci: Refactoring and harmonizing GitHub Action workflows
Signed-off-by: Vincent Boutour <[email protected]>
1 parent caac54a commit b5a6d95

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed

.github/workflows/branch_clean.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
---
12
name: Git
2-
on: [pull_request]
3+
4+
on:
5+
- pull_request
6+
37
jobs:
48
build:
59
name: Branch is clean
610
runs-on: ubuntu-latest
711
steps:
8-
- name: Check out code
12+
- name: Checkout
913
uses: actions/checkout@v2
1014
with:
1115
ref: ${{ github.event.pull_request.head.sha }}
@@ -15,7 +19,7 @@ jobs:
1519
git fetch --no-tags --prune origin "+refs/heads/${BASE}:refs/remotes/origin/${BASE}"
1620
env:
1721
BASE: ${{ github.base_ref }}
18-
- name: Check commits description
22+
- name: Check commits
1923
env:
2024
BASE: origin/${{ github.base_ref }}
2125
HEAD: HEAD

.github/workflows/build.yaml

+17-10
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,37 @@ jobs:
2222
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-go@v2
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup Golang
28+
uses: actions/setup-go@v2
2729
with:
2830
go-version: "^1.16"
29-
- run: |
31+
- name: Build
32+
run: |
3033
make
3134
git --no-pager diff -- ':(exclude)go.sum' && git diff --quiet -- ':(exclude)go.sum'
32-
- uses: codecov/codecov-action@v1
35+
- name: Codecov
36+
uses: codecov/codecov-action@v1
3337

3438
package:
3539
name: Docker
3640
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
3741
runs-on: ubuntu-latest
3842
steps:
39-
- name: Set up Docker Buildx
40-
uses: docker/setup-buildx-action@v1
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-go@v2
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
- name: Setup Golang
46+
uses: actions/setup-go@v2
4347
with:
4448
go-version: "^1.16"
4549
- name: Build
4650
run: |
4751
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap" | bash -s "release"
4852
./scripts/release build
49-
- name: Login to DockerHub
53+
- name: Setup Docker
54+
uses: docker/setup-buildx-action@v1
55+
- name: Setup DockerHub
5056
if: env.DOCKER_USER && env.DOCKER_PASS
5157
env:
5258
DOCKER_USER: ${{ secrets.DOCKER_USER }}
@@ -69,7 +75,8 @@ jobs:
6975
runs-on: ubuntu-latest
7076
needs: package
7177
steps:
72-
- uses: actions/checkout@v2
78+
- name: Checkout
79+
uses: actions/checkout@v2
7380
- name: Publish
7481
env:
7582
DOCKER_USER: ${{ secrets.DOCKER_USER }}
+12-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: "CodeQL"
1+
---
2+
name: CodeQL
3+
24
on:
35
push:
46
branches:
@@ -8,6 +10,7 @@ on:
810
- main
911
schedule:
1012
- cron: "0 0 * * 6"
13+
1114
jobs:
1215
analyze:
1316
name: Analyze
@@ -16,19 +19,20 @@ jobs:
1619
strategy:
1720
fail-fast: false
1821
matrix:
19-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
20-
language: ["go"]
22+
language:
23+
- go
2124
steps:
22-
- name: Checkout repository
25+
- name: Checkout
2326
uses: actions/checkout@v2
24-
- name: Initialize CodeQL
27+
- name: Setup CodeQL
2528
uses: github/codeql-action/init@v1
2629
with:
2730
languages: ${{ matrix.language }}
28-
- uses: actions/setup-go@v2
31+
- name: Setup Golang
32+
uses: actions/setup-go@v2
2933
with:
3034
go-version: "^1.16"
31-
- name: Autobuild
35+
- name: Build
3236
run: make build
33-
- name: Perform CodeQL Analysis
37+
- name: CodeQL
3438
uses: github/codeql-action/analyze@v1

.github/workflows/herodote.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
---
12
name: Herodote
3+
24
on:
35
push:
46
branches:
57
- main
8+
69
jobs:
710
build:
811
name: Feed
912
runs-on: ubuntu-latest
1013
steps:
11-
- name: Fetch history
14+
- name: Checkout
1215
uses: actions/checkout@v2
1316
with:
1417
ref: ${{ github.event.pull_request.head.sha }}
1518
fetch-depth: 0
16-
- name: Push history
19+
- name: Push
1720
run: |
1821
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/herodote/main/herodote.sh" | bash
1922
env:

0 commit comments

Comments
 (0)