mirror of
https://github.com/nwtgck/handy-sshd.git
synced 2025-06-07 14:43:05 +00:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
32 lines
1 KiB
YAML
32 lines
1 KiB
YAML
name: CI
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.20"
|
|
- name: Build for multi-platform
|
|
run: |
|
|
set -xeu
|
|
DIST=dist
|
|
mkdir $DIST
|
|
# (from: https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04)
|
|
platforms=("linux/amd64" "darwin/amd64" "linux/arm" "windows/amd64")
|
|
for platform in "${platforms[@]}"
|
|
do
|
|
platform_split=(${platform//\// })
|
|
export GOOS=${platform_split[0]}
|
|
export GOARCH=${platform_split[1]}
|
|
[ $GOOS = "windows" ] && EXTENSION='.exe' || EXTENSION=''
|
|
BUILD_PATH=handy-sshd-$GOOS-$GOARCH
|
|
mkdir $BUILD_PATH
|
|
# Build
|
|
CGO_ENABLED=0 go build -o "${BUILD_PATH}/handy-sshd${EXTENSION}" main/main.go
|
|
done
|
|
- name: Test
|
|
run: go test -v ./...
|