-
Notifications
You must be signed in to change notification settings - Fork 165
92 lines (84 loc) · 1.99 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.20' ]
os: [ 'ubuntu-22.04', 'macos-12', 'windows-2022' ]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Go build
run: |
git rev-parse --short "$GITHUB_SHA" | tr -d '\n' > ./version.txt
go build .
./gitql -v
unit:
needs:
- build
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.20' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-22.04' ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run unit tests
run: go test -v ./...
functional:
needs:
- unit
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.20' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-22.04', 'macos-12', 'windows-2022' ]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.2.1
- name: Run functional tests
run: |
git stash -u
go build .
./gitql -v
bats ./test
upload:
needs:
- functional
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ '1.20' ] # Check the binary of the latest go version is enough
os: [ 'ubuntu-22.04', 'macos-12', 'windows-2022' ]
steps:
- uses: actions/checkout@v4
- run: go build .
- uses: actions/upload-artifact@master
name: Upload binary ${{ runner.os }}
with:
name: gitql-${{ runner.os }}
path: ./gitql*