-
Notifications
You must be signed in to change notification settings - Fork 23
183 lines (172 loc) · 5.43 KB
/
Copy pathtest.yaml
File metadata and controls
183 lines (172 loc) · 5.43 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# SPDX-FileCopyrightText: The RamenDr authors
# SPDX-License-Identifier: Apache-2.0
---
name: Test
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
spell:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Run codespell
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2.2
with:
skip: go.sum
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
version: latest
htmlfmt:
name: HTML Format
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Check HTML formatting
run: |
make htmlfmt
git diff --exit-code
mdformat:
name: Markdown Format
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Install mdformat
run: pip3 install -r requirements.txt
- name: Check markdown formatting
run: git ls-files -z '*.md' | xargs -0 mdformat --check
tidy:
name: Go Mod Tidy
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Check go modules are tidy
run: |
go mod tidy
git --no-pager diff --exit-code
build-matrix:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goarch: arm64
goos: windows
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Create build tag
run: git tag build-${{ github.run_id }}-${{ github.run_attempt }}
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Download modules
run: go mod download
- name: Build binary
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} make
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ramenctl-${{ matrix.goos }}-${{ matrix.goarch }}
path: ramenctl*
retention-days: 15
compression-level: 9
go-compatibility:
name: Go compatibility
runs-on: ubuntu-24.04
env:
GOTOOLCHAIN: local
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Extract go version
id: go-version
run: |
version=$(awk '/^go [0-9]/ {print $2}' go.mod)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
# We cannot use go-version-file since in v6 it picks the toolchain
# version instead of go version, ignoring GOTOOLCHAIN=local.
go-version: ${{ steps.go-version.outputs.version }}
cache: false
- name: Build ramenctl
run: make
test-matrix:
name: Test
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runner:
- ubuntu-24.04 # x86_64
- ubuntu-24.04-arm # arm64
- windows-latest # x86_64
- macos-15-intel # x86_64
- macos-15 # arm64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout source
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Create build tag
run: git tag latest
- name: Setup go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Download modules
run: go mod download
- name: Run tests
run: make test