Skip to content

Commit

Permalink
chore: Add make codegen to ci (#939)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Nov 17, 2020
1 parent 9c1d7dd commit 42ac21d
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 51 deletions.
59 changes: 56 additions & 3 deletions .github/workflows/go.yaml
@@ -1,18 +1,21 @@
name: test
on:
push:
branches: [ master ]
branches:
- "master"
- "release-*"
pull_request:
branches: [ master ]
jobs:
build:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
go-version: "1.15.3"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -24,4 +27,54 @@ jobs:
- name: Get dependencies
run: go mod download
- name: Test
run: make test
run: make test

codegen:
name: Codegen
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Restore go build cache
uses: actions/cache@v1
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }}
- name: Setup Golang
uses: actions/setup-go@v1
with:
go-version: "1.15.3"
- name: Add bins to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
echo /usr/local/bin >> $GITHUB_PATH
- name: Install protoc
run: |
set -eux -o pipefail
PROTOC_ZIP=protoc-3.11.1-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.1/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
sudo chmod +x /usr/local/bin/protoc
sudo find /usr/local/include -type f | xargs sudo chmod a+r
sudo find /usr/local/include -type d | xargs sudo chmod a+rx
rm -f $PROTOC_ZIP
ls /usr/local/include/google/protobuf/
- name: Install pandoc
run: |
set -eux -o pipefail
PANDOC_ZIP=pandoc-2.11.1-linux-amd64.tar.gz
curl -OL https://github.com/jgm/pandoc/releases/download/2.11.1/$PANDOC_ZIP
sudo tar xvzf $PANDOC_ZIP --strip-components 1 -C /usr/local
rm -f $PANDOC_ZIP
echo /usr/local/pandoc-2.11.1/bin >> $GITHUB_PATH
- name: Get dependencies
run: go mod download
- name: Make codegen
run: |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV
make -B codegen
- name: Ensure nothing changed
run: git diff --exit-code

9 changes: 6 additions & 3 deletions .github/workflows/golangci-lint.yml
Expand Up @@ -10,7 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add to PATH
run: |
echo /home/runner/go/bin >> $GITHUB_PATH
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.26
run: |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV
make lint
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -19,7 +19,7 @@ override LDFLAGS += \
# docker image publishing options
DOCKER_PUSH?=false
IMAGE_NAMESPACE?=argoproj
IMAGE_TAG?=v1.0.0
IMAGE_TAG?=latest

ifeq (${DOCKER_PUSH},true)
ifndef IMAGE_NAMESPACE
Expand Down
24 changes: 8 additions & 16 deletions go.mod
Expand Up @@ -25,14 +25,14 @@ require (
github.com/fatih/color v1.9.0 // indirect
github.com/fsnotify/fsnotify v1.4.9
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-openapi/spec v0.19.7
github.com/go-openapi/swag v0.19.8 // indirect
github.com/go-openapi/spec v0.19.8
github.com/go-redis/redis v6.15.8+incompatible
github.com/go-resty/resty/v2 v2.3.0
github.com/go-swagger/go-swagger v0.25.0
github.com/gobwas/glob v0.2.4-0.20181002190808-e7a84e9525fe
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.5
github.com/google/go-cmp v0.4.0
github.com/golang/protobuf v1.4.2
github.com/google/go-cmp v0.5.0
github.com/google/go-github/v31 v31.0.0
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.1
Expand All @@ -46,12 +46,9 @@ require (
github.com/imdario/mergo v0.3.9
github.com/joncalhoun/qson v0.0.0-20200422171543-84433dcd3da0
github.com/json-iterator/go v1.1.9 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/minio/minio-go v1.0.1-0.20190523192347-c6c2912aa552
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.3.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/nats-io/gnatsd v1.4.1 // indirect
github.com/nats-io/go-nats v1.7.2
Expand All @@ -61,7 +58,6 @@ require (
github.com/nats-io/stan.go v0.6.0
github.com/nicksnyder/go-i18n v1.10.1-0.20190510212457-b280125b035a // indirect
github.com/nsqio/go-nsq v1.0.8
github.com/pelletier/go-toml v1.7.0 // indirect
github.com/pierrec/lz4 v2.5.0+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.1.0 // indirect
Expand All @@ -73,24 +69,20 @@ require (
github.com/slack-go/slack v0.6.5
github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3 // indirect
github.com/smartystreets/goconvey v1.6.4
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.3.2
github.com/spf13/viper v1.7.0
github.com/streadway/amqp v1.0.0
github.com/stretchr/testify v1.5.1
github.com/stretchr/testify v1.6.1
github.com/stripe/stripe-go v70.15.0+incompatible
github.com/tidwall/gjson v1.6.0
github.com/tidwall/sjson v1.1.1
github.com/xanzy/go-gitlab v0.33.0
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c // indirect
golang.org/x/tools v0.0.0-20200408132156-9ee5ef7a2c0d // indirect
google.golang.org/api v0.15.0
google.golang.org/genproto v0.0.0-20200408120641-fbb3ad325eb7 // indirect
google.golang.org/grpc v1.28.1
gopkg.in/ini.v1 v1.55.0 // indirect
gopkg.in/jcmturner/goidentity.v2 v2.0.0 // indirect
gopkg.in/jcmturner/gokrb5.v5 v5.3.0
gopkg.in/jcmturner/rpc.v0 v0.0.2 // indirect
Expand All @@ -104,7 +96,7 @@ require (
k8s.io/kube-openapi v0.0.0-20200316234421-82d701f24f9d
k8s.io/utils v0.0.0-20200327001022-6496210b90e8 // indirect
sigs.k8s.io/controller-runtime v0.5.4
sigs.k8s.io/controller-tools v0.2.5
sigs.k8s.io/controller-tools v0.2.9
sigs.k8s.io/yaml v1.2.0
)

Expand Down

0 comments on commit 42ac21d

Please sign in to comment.