forked from percona/pmm
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 1.89 KB
/
qan-api2.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
name: QAN
on:
push:
branches:
- main
- pmm-*
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
paths-ignore:
- "admin/**"
- "agent/**"
- "docs/**"
- "managed/**"
- "update/**"
- "vmproxy/**"
workflow_call:
inputs:
go-version:
description: An array of Go versions to be tested against, in a format of json string.
required: false
type: string
default: '["tip"]'
jobs:
test:
name: Test QAN
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(inputs.go-version || '["1.18.x"]') }}
env:
GO_VERSION: ${{ matrix.go-version }}
defaults:
run:
working-directory: ${{ github.workspace }}/qan-api2
steps:
- name: Checkout code
uses: percona-platform/checkout@v3
- name: Set up Go release
if: env.GO_VERSION != 'tip'
uses: percona-platform/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Go tip
if: env.GO_VERSION == 'tip'
env:
# to avoid error due to `go version` accepting -v flag with an argument since 1.15
GOFLAGS: ""
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Download Go modules
run: go mod download
- name: Build and install
run: make install
- name: Initialize CI environment
run: make test-env-up
- name: Run Tests
run: |
make test-race
make test-cover
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
git status