-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use zig for goreleaser * added test workflow * Revert "added test workflow" This reverts commit 9c55c5f. * added goreleaser test * autorun goreleaser tests * add pseudo tag for goreleaser * added test * added arm test * arch test * missing qemu setup? * test alternate run * test rework * path fix? * 18 won't run * another test * permission fix * amd64 matrix * added macos * added windows test * consolidate unix tests * fix path * fix path2 * matrix consolidation * +x fails on macos * fix runner * windows fix * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com> * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com> * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com> * Update .github/workflows/goreleaser-test.yml Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com> * auto test binaries on release --------- Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
- Loading branch information
1 parent
ed00064
commit 1d25cca
Showing
3 changed files
with
153 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Setup Zig | ||
uses: goto-bus-stop/setup-zig@v2 | ||
|
||
- name: Run GoReleaser check | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: check | ||
|
||
- name: Run GoReleaser build | ||
uses: goreleaser/goreleaser-action@v4 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters