-
Notifications
You must be signed in to change notification settings - Fork 163
117 lines (106 loc) · 2.64 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.16', '1.15' ]
os: [ 'ubuntu-20.04', 'macos-10.15', 'windows-2019' ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v1
with:
submodules: true
fetch-depth: 0
path: go/src/github.com/cloudson/gitql
- name: Go build
run: |
go build .
./gitql -v
- name: Cache source code
uses: actions/cache@v2
env:
cache-name: source-code
with:
path: |
./*
key: build-${{ matrix.os }}-${{ matrix.go }}-${{ env.cache-name }}
unit:
needs:
- build
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.16' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-20.04', 'macos-10.15', 'windows-2019' ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 0
path: go/src/github.com/cloudson/gitql
- name: Run unit tests
run: |
go test -v ./...
functional:
needs:
- unit
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.16' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-20.04', 'macos-10.15' ]
steps:
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: source-code
with:
path: |
./*
key: build-${{ matrix.os }}-${{ matrix.go }}-${{ env.cache-name }}
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.2.1
- name: Run functional tests
run: |
./gitql "use main"
bats ./test
upload:
needs:
- functional
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.16' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-20.04', 'macos-10.15', 'windows-2019' ]
steps:
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: source-code
with:
path: |
./*
key: build-${{ matrix.os }}-${{ matrix.go }}-${{ env.cache-name }}
- uses: actions/upload-artifact@master
name: Upload binary ${{ runner.os }}
with:
name: gitql-${{ runner.os }}
path: ./gitql*