This repository was archived by the owner on Sep 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (108 loc) · 3.48 KB
/
go.yml
File metadata and controls
132 lines (108 loc) · 3.48 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Go
env:
GO_VERSION: ^1.14
BIN_NAME: sb-flunky
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build & Unit tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v ./...
- name: Test
run: |
go test -short -timeout 10m -v ./... -coverpkg=github.com/jfrog/jfrog-support-bundle-flunky/... -coverprofile=coverage.txt -covermode=count
- name: Upload coverage report to Codecov.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unit-tests
integration-test:
name: Integration tests
runs-on: ubuntu-latest
strategy:
matrix:
artifactory: [ '7.2.1', '7.3.2', '7.4.3', '7.5.7', '7.6.3', '7.7.8', '7.9.2', '7.10.6', 'latest' ]
needs: build
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
- name: Test
env:
TEST_LICENSE: ${{ secrets.TEST_LICENSE }}
ARTIFACTORY_VERSION: ${{ matrix.artifactory }}
run: go test -run Integration -timeout 30m -v ./test/... -coverpkg=github.com/jfrog/jfrog-support-bundle-flunky/... -coverprofile=coverage.txt -covermode=count
- name: Upload coverage report to Codecov.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: integration-tests
build-binaries:
name: Build binary
runs-on: ubuntu-latest
strategy:
matrix:
os: [ 'windows', 'darwin', 'linux' ]
arch: [ 'amd64', '386' ]
exclude:
- os: darwin
arch: 386
include:
- os: linux
arch: arm
- os: linux
arch: arm64
fail-fast: false
needs: build
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
- name: Build
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ${{ env.BIN_NAME }}-${{ matrix.os }}-${{ matrix.arch }} main.go
- name: Rename binary (Windows-only)
if: ${{ matrix.os == 'windows' }}
run: mv ${{ env.BIN_NAME }}-${{ matrix.os }}-${{ matrix.arch }} ${{ env.BIN_NAME }}-${{ matrix.os }}-${{ matrix.arch }}.exe
- name: Save binary
uses: actions/upload-artifact@v2
with:
name: ${{ env.BIN_NAME }}-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ env.BIN_NAME }}*
if-no-files-found: error