Skip to content

Commit

Permalink
switch to assert
Browse files Browse the repository at this point in the history
  • Loading branch information
clovis818 committed Sep 16, 2024
2 parents 8ac3df7 + fc2f569 commit d7435a6
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI Pipeline

on:
push:
branches:
- main
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [1.22.x]
os: [linux, darwin, windows]
arch: [amd64, arm64]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
run: go mod tidy

- name: Run unit tests
run: go test -v ./...

- name: Build binaries
run: |
if [ "${{ matrix.os }}" == "linux" ]; then
GOOS=linux GOARCH=${{ matrix.arch }} go build -o run-all-linux-${{ matrix.arch }} ./cmd/run-all
zip run-all-linux-${{ matrix.arch }}.zip run-all-linux-${{ matrix.arch }}
elif [ "${{ matrix.os }}" == "darwin" ]; then
GOOS=darwin GOARCH=${{ matrix.arch }} go build -o run-all-darwin-${{ matrix.arch }} ./cmd/run-all
zip run-all-darwin-${{ matrix.arch }}.zip run-all-darwin-${{ matrix.arch }}
elif [ "${{ matrix.os }}" == "windows" ]; then
GOOS=windows GOARCH=${{ matrix.arch }} go build -o run-all-windows-${{ matrix.arch }}.exe ./cmd/run-all
zip run-all-windows-${{ matrix.arch }}.zip run-all-windows-${{ matrix.arch }}.exe
fi
shell: bash

- name: Generate SHA256 checksums
run: |
if [ "${{ matrix.os }}" == "linux" ]; then
shasum -a 256 run-all-linux-${{ matrix.arch }}.zip > run-all-linux-${{ matrix.arch }}.zip.sha256
elif [ "${{ matrix.os }}" == "darwin" ]; then
shasum -a 256 run-all-darwin-${{ matrix.arch }}.zip > run-all-darwin-${{ matrix.arch }}.zip.sha256
elif [ "${{ matrix.os }}" == "windows" ]; then
shasum -a 256 run-all-windows-${{ matrix.arch }}.zip > run-all-windows-${{ matrix.arch }}.zip.sha256
fi
shell: bash

- name: List files (debugging)
run: ls -alh

- name: Upload zipped binaries and checksums as artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}-${{ matrix.arch }}
path: |
run-all-${{ matrix.os }}-${{ matrix.arch }}.zip
run-all-${{ matrix.os }}-${{ matrix.arch }}.zip.sha256

0 comments on commit d7435a6

Please sign in to comment.