Skip to content

Commit 29a1525

Browse files
committed
BUILD/MINOR: ci: create workflow for github
1 parent 80ea2b4 commit 29a1525

File tree

5 files changed

+63
-72
lines changed

5 files changed

+63
-72
lines changed

.github/workflows/actions.yaml

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