Skip to content

Commit

Permalink
build(ci): Add workflow for building PRs (PR: #19)
Browse files Browse the repository at this point in the history
* build(ci): update actions

* build(ci): use Go v1.21

* build(ci): add workflow to test building
  • Loading branch information
duncanleo authored Dec 17, 2023
1 parent e67ed63 commit 2deb25d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Go 1.17
uses: actions/setup-go@v2
- name: Set up Golang
uses: actions/setup-go@v4
with:
go-version: 1.17
go-version: 1.21
id: go

- name: Use Node.js 14.x
uses: actions/setup-node@v2
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- name: Extract branch name
shell: bash
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Build

on:
pull_request:
types: [synchronize]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Golang
uses: actions/setup-go@v4
with:
go-version: 1.21
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -v -o ${GITHUB_REPOSITORY##*/}-linux-x64 ./cmd/...
GOOS=linux GOARCH=arm GOARM=5 go build -v -o ${GITHUB_REPOSITORY##*/}-linux-armv5 ./cmd/...
GOOS=linux GOARCH=arm64 go build -v -o ${GITHUB_REPOSITORY##*/}-linux-arm64 ./cmd/...
GOOS=darwin GOARCH=amd64 go build -v -o ${GITHUB_REPOSITORY##*/}-darwin-amd64 ./cmd/...
GOOS=darwin GOARCH=arm64 go build -v -o ${GITHUB_REPOSITORY##*/}-darwin-arm64 ./cmd/...
GOOS=windows GOARCH=amd64 go build -v -o ${GITHUB_REPOSITORY##*/}-windows-amd64.exe ./cmd/...
GOOS=windows GOARCH=386 go build -v -o ${GITHUB_REPOSITORY##*/}-windows-i386.exe ./cmd/...
GOOS=windows GOARCH=arm go build -v -o ${GITHUB_REPOSITORY##*/}-windows-arm.exe ./cmd/...
GOOS=windows GOARCH=arm64 go build -v -o ${GITHUB_REPOSITORY##*/}-windows-arm64.exe ./cmd/...

0 comments on commit 2deb25d

Please sign in to comment.