Skip to content

Commit db76da3

Browse files
committed
BUILD/MINOR: ci: create workflow for github
1 parent 4a5e14d commit db76da3

File tree

5 files changed

+61
-72
lines changed

5 files changed

+61
-72
lines changed

.github/workflows/actions.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
go_lint:
5+
name: golangci-lint
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code into the Go module directory
9+
uses: actions/checkout@v2
10+
- name: golangci-lint
11+
uses: docker://ghcr.io/haproxytech/go-linter:1.33
12+
check:
13+
if: ${{ github.event_name == 'pull_request' }}
14+
name: HAProxy check commit message
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: commit-check
18+
uses: docker://ghcr.io/haproxytech/commit-check:3.0.0
19+
env:
20+
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
go_build:
22+
name: build
23+
runs-on: ubuntu-latest
24+
needs: ["go_lint"]
25+
steps:
26+
- name: Set up Go 1.17
27+
uses: actions/setup-go@v1
28+
with:
29+
go-version: 1.17
30+
id: go
31+
- name: Check out code into the Go module directory
32+
uses: actions/checkout@v1
33+
- name: Get dependencies
34+
run: |
35+
go get -v -t -d ./...
36+
- name: Build
37+
run: |
38+
go build -v .
39+
e2e:
40+
name: HAProxy
41+
needs: ["go_lint","go_build"]
42+
strategy:
43+
matrix:
44+
haproxy_version: ["2.1", "2.2", "2.3"]
45+
runs-on: ubuntu-latest
46+
env:
47+
BATS_VERSION: v1.4.1
48+
steps:
49+
- name: Check out code into the Go module directory
50+
uses: actions/checkout@v2
51+
- name: Downloading required packages
52+
run: sudo apt-get install
53+
- name: Install bats
54+
run: git clone https://github.com/bats-core/bats-core.git && cd bats-core && git checkout $BATS_VERSION && sudo ./install.sh /usr/local && cd ..
55+
- name: Set up Go 1.17
56+
uses: actions/setup-go@v1
57+
with:
58+
go-version: 1.17
59+
- run: make e2e
60+
env:
61+
HAPROXY_VERSION: ${{ matrix.haproxy_version }}

.github/workflows/build.yml

-24
This file was deleted.

.github/workflows/check.yml

-10
This file was deleted.

.github/workflows/e2e.yml

-25
This file was deleted.

.github/workflows/lint.yml

-13
This file was deleted.

0 commit comments

Comments
 (0)