forked from 0xERR0R/blocky
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (124 loc) · 3.68 KB
/
goreleaser-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
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
name: GoReleaser Test
on:
push:
tags:
- v*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build binaries with goreleaser
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
- name: Run GoReleaser check
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: check
- name: Run GoReleaser build
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: build --clean --snapshot
- name: Upload dist folder
uses: actions/upload-artifact@v3
with:
name: dist_folder
path: dist
retention-days: 1
tests:
name: Test binaries
runs-on: ${{matrix.runner}}
needs: build
strategy:
matrix:
distro: [ubuntu16.04, ubuntu18.04, ubuntu20.04, ubuntu22.04, bullseye, buster, stretch]
arch: [armv7,aarch64]
os: [linux]
runner: [ubuntu-latest]
include:
- distro: stretch
runner: ubuntu-latest
arch: armv6
os: linux
- distro: buster
runner: ubuntu-latest
arch: armv6
os: linux
- distro: bullseye
runner: ubuntu-latest
arch: armv6
os: linux
- distro: ubuntu20.04
runner: ubuntu-20.04
arch: amd64
os: linux
- distro: ubuntu22.04
runner: ubuntu-22.04
arch: amd64
os: linux
- distro: macos
runner: macos-11
arch: amd64
os: darwin
- distro: macos
runner: macos-12
arch: amd64
os: darwin
- distro: windows
runner: windows-latest
arch: amd64
os: windows
steps:
- name: Download dist folder
id: download
uses: actions/download-artifact@v3
with:
name: dist_folder
- name: Get binary path
id: get_path
if: matrix.os != 'windows'
shell: bash
run: |
archs=(["aarch64"]="arm64" ["armv6"]="arm_6" ["armv7"]="arm_7" ["amd64"]="amd64_v1")
BINPATH="${{steps.download.outputs.download-path}}/blocky_${{ matrix.os }}_${archs[ ${{ matrix.arch }} ]}/blocky"
echo "bin=${BINPATH}" >> "$GITHUB_OUTPUT"
echo "Binary path: ${BINPATH}"
- name: Enable execution
if: matrix.os != 'windows'
shell: bash
run: |
chmod +x '${{ steps.get_path.outputs.bin }}'
- name: Test binary on ${{ matrix.arch }}
if: matrix.arch != 'amd64'
uses: uraimo/run-on-arch-action@v2
with:
distro: ${{ matrix.distro }}
arch: ${{ matrix.arch }}
dockerRunArgs: |
--volume "${{steps.download.outputs.download-path}}:${{steps.download.outputs.download-path}}"
shell: /bin/sh
run: |
'${{ steps.get_path.outputs.bin }}' version
- name: Test binary on amd64
if: matrix.arch == 'amd64' && matrix.os != 'windows'
shell: bash
run: |
'${{ steps.get_path.outputs.bin }}' version
- name: Test windows binary
if: matrix.os == 'windows'
shell: cmd
run: |
${{steps.download.outputs.download-path}}\blocky_windows_amd64_v1\blocky.exe version