Skip to content

Commit de42c4c

Browse files
committed
aaaBUILD/MINOR: ci: create workflow for github
1 parent 80ea2b4 commit de42c4c

4 files changed

Lines changed: 62 additions & 62 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/e2e.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/github.yaml

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

.github/workflows/lint.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)