Skip to content

Commit

Permalink
adding in build files (#3)
Browse files Browse the repository at this point in the history
* adding in build files

* updates

* Fixing make

* Adding gopath

* Removing checkout path

* ginkgo

* adding goreleaser

* revive

* env vars

* gopath

* env

* workspace

* stuffs

* install

* versions

* default checkout dir

* ginkgo
  • Loading branch information
rshade authored Jul 8, 2022
1 parent d553a1e commit 7acccab
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 16 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: make-depend
run: make depend
go-version: 1.18
- name: Checkout Code
uses: actions/checkout@v2
- name: Debug
run: |
pwd
echo ${HOME}
echo ${GITHUB_WORKSPACE}
echo ${GOPATH}
echo ${GOROOT}
go install golang.org/x/tools/cmd/cover@latest
go install github.com/onsi/ginkgo/ginkgo@v1.16.5
go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
- name: Build
run: make build
- name: Tidy
run: go mod tidy

- name: Run Revive Action by pulling pre-built image
uses: docker://morphy/revive-action:v2
- name: Test
run: make test

run: |
ginkgo -r -cover
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# workflow name
name: Generate release-artifacts

# on events
on:
release:
types:
- created

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
-
name: make-depend
run: make depend
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload assets
uses: actions/upload-artifact@v3
with:
name: myapp
path: dist/*
19 changes: 19 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
builds:
- binary: wstunnel
env:
- GO111MODULE=on
goarch:
- amd64
- arm64
- 386
goos:
- darwin
- windows
- linux
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: 386
- goos: darwin
goarch: 386
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ version:
# Travis doing this. The folllowing just relies on go get no reinstalling when it's already
# there, like your laptop.
depend:
go get $(DEPEND)
go get -u $(DEPEND)

clean:
@echo "package main; const VV = \"$(NAME) unversioned - $(DATE)\"" >version.go
Expand All @@ -126,12 +126,12 @@ lint:
go vet ./...

travis-test: lint
ginkgo -r -cover
$(GOPATH)/bin/ginkgo -r -cover

# running ginkgo twice, sadly, the problem is that -cover modifies the source code with the effect
# that if there are errors the output of gingko refers to incorrect line numbers
# tip: if you don't like colors use ginkgo -r -noColor
test: lint
ginkgo -r
ginkgo -r -cover
test: lint depend
$(GOPATH)/bin/ginkgo -r
$(GOPATH)/bin/ginkgo -r -cover
go tool cover -func=`basename $$PWD`.coverprofile
18 changes: 18 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,31 @@ module github.com/rightscale/wstunnel
go 1.16

require (
github.com/AlecAivazis/survey/v2 v2.3.5 // indirect
github.com/andygrunwald/go-jira v1.15.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/git-chglog/git-chglog v0.15.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/kyokomi/emoji/v2 v2.2.9 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.19.0
github.com/rlmcpherson/s3gof3r v0.5.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/urfave/cli/v2 v2.10.3 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/tools v0.1.11 // indirect
gopkg.in/inconshreveable/log15.v2 v2.0.0-20200109203555-b30bc20e4fd1
)
Loading

0 comments on commit 7acccab

Please sign in to comment.