-
Notifications
You must be signed in to change notification settings - Fork 23
108 lines (102 loc) · 2.68 KB
/
Copy pathtest.yaml
File metadata and controls
108 lines (102 loc) · 2.68 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
# SPDX-FileCopyrightText: The RamenDr authors
# SPDX-License-Identifier: Apache-2.0
---
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
spell:
name: Spell Check
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Run codespell
uses: codespell-project/actions-codespell@v2
with:
skip: go.sum
lint:
name: Lint
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.0
build-matrix:
name: Build
permissions:
contents: read
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@v4
- name: Create build tag
run: git tag build-${{ github.run_id }}-${{ github.run_attempt }}
- name: Setup go
uses: actions/setup-go@v5
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@v4
with:
name: ramenctl-${{ matrix.goos }}-${{ matrix.goarch }}
path: ramenctl*
retention-days: 15
compression-level: 9
test-matrix:
name: Test
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-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-13 # x86_64
- macos-15 # arm64
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Create build tag
run: git tag latest
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Download modules
run: go mod download
- name: Run tests
run: make test