-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.48 KB
/
go-test.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
name: Tests
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '**.sh'
- '**.gitignore'
- 'build-name'
- 'build-ver'
- 'major-ver'
- 'minor-ver'
jobs:
#**********************************************************************************************************************#
test-module:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Action init
uses: actions/checkout@v4
########################################################################################################################
- name: Cache [ubuntu] init
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
go.sum
go.sum
key: ${{ runner.os }}-go-local
restore-keys: ${{ runner.os }}-go-
- name: Cache [macos] init
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/cache@v4
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
go.sum
go.sum
key: ${{ runner.os }}-go-local
restore-keys: ${{ runner.os }}-go-
enableCrossOsArchive: true
- name: Cache [windows] init
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/cache@v4
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
go.sum
go.sum
key: ${{ runner.os }}-go-local
restore-keys: ${{ runner.os }}-go-
enableCrossOsArchive: true
########################################################################################################################
- name: Goland init
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: go.sum [macos, ubuntu] init
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' }}
run: |
if [ ! -f "go.sum" ]; then
go mod tidy
fi
working-directory: ${{ github.workspace }}
- name: go.sum [windows] init
if: ${{ matrix.os == 'windows-latest' }}
run: |
if (-not (Test-Path "go.sum")) {
go mod tidy
}
working-directory: ${{ github.workspace }}
########################################################################################################################
- name: Start Test
run: go test