-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: build examples for rudimentary CI
Fixes #118 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
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,44 @@ | ||
name: Build Examples | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
# all PRs on all branches | ||
|
||
concurrency: | ||
# For PRs, later CI runs preempt previous ones. e.g. a force push on a PR | ||
# cancels running CI jobs and starts all new ones. | ||
# | ||
# For non-PR pushes, concurrency.group needs to be unique for every distinct | ||
# CI run we want to have happen. Use run_id, which in practice means all | ||
# non-PR CI runs will be allowed to run without preempting each other. | ||
group: ${{ github.workflow }}-$${{ github.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
goarch: [ "386", "amd64", "arm64" ] | ||
runs-on: linux-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Set up build directory | ||
run: | | ||
mkdir -p ./examples/bin | ||
- name: Build Binaries | ||
run: | | ||
go build -v -ldflags="-H windowsgui" -o ./examples/bin ./examples/... | ||
env: | ||
GOARCH: ${{ matrix.goarch }} | ||
GOOS: windows |