Skip to content

Commit

Permalink
Merge pull request #1 from 2lambda123/github-actions
Browse files Browse the repository at this point in the history
add github actions
  • Loading branch information
2lambda123 authored Aug 22, 2024
2 parents caaf2b7 + fcdecec commit 360822b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on: [pull_request]

jobs:
unit-tests:
name: vet and test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.12
- uses: actions/checkout@v2
with:
path: src/github.com/go-ping/ping
- run: |
export GOPATH=$GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/src/github.com/go-ping/ping
go get ./...
go vet ./...
go test ./... -cover -race
build-ping-cmd:
name: build ping command and run
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.12
- uses: actions/checkout@v2
with:
path: src/github.com/go-ping/ping
- run: |
export GOPATH=$GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/src/github.com/go-ping/ping
go build -race -o ping_linux ./cmd/ping/ping.go
sudo ./ping_linux --privileged -c 2 www.google.com
sudo ./ping_linux --privileged -c 3 -i 200ms www.google.com
sudo ./ping_linux --privileged -c 10 -i 100ms -t 1s www.google.com
x-platform-build:
name: cross platform build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.12
- uses: actions/checkout@v2
with:
path: src/github.com/aws/amazon-ecs-agent
- run: |
export GOPATH=$GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE/src/github.com/go-ping/ping
GOOS=darwin go build -o ping_darwin ./cmd/ping/ping.go

0 comments on commit 360822b

Please sign in to comment.