Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 335a366

Browse files
committed
BUILD/MAJOR: add go tests checks to CI
1 parent 9e51828 commit 335a366

File tree

2 files changed

+58
-32
lines changed

2 files changed

+58
-32
lines changed

.github/workflows/actions.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
go_lint:
5+
name: Go lint
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: golangci-lint
10+
uses: golangci/golangci-lint-action@v2
11+
with:
12+
working-directory: check-commit
13+
check_commit:
14+
if: ${{ github.event_name == 'pull_request' }}
15+
name: HAProxy check commit message
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
- name: check-commit
22+
uses: docker://haproxytech/check-commit:latest
23+
env:
24+
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
go_build:
26+
name: Go build
27+
runs-on: ubuntu-latest
28+
needs: ["go_lint"]
29+
steps:
30+
- name: Check out code into the Go module directory
31+
uses: actions/checkout@v2
32+
- name: Set up Go 1.17
33+
uses: actions/setup-go@v2
34+
with:
35+
go-version: 1.17
36+
id: go
37+
- name: Get dependencies
38+
run: |
39+
cd check-commit && go get -v -t -d ./...
40+
- name: Build
41+
run: |
42+
cd check-commit && go build -v .
43+
go_test:
44+
name: Go test
45+
runs-on: ubuntu-latest
46+
needs: ["go_lint"]
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: actions/setup-go@v2
50+
with:
51+
go-version: 1.17
52+
id: go
53+
- name: Get dependencies
54+
run: |
55+
cd check-commit && go get -v -t -d ./...
56+
- name: Build
57+
run: |
58+
cd check-commit && go test ./...

.github/workflows/main.yml

-32
This file was deleted.

0 commit comments

Comments
 (0)