Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hale committed Dec 17, 2023
1 parent 2f49778 commit b12cf22
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 35 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
env:
GOPATH: /home/runner/go
GOCACHE: /home/runner/go/.cache
jobs:
pull-request-status-checks:
runs-on: ubuntu-latest
Expand All @@ -9,15 +12,23 @@ jobs:
run: |
echo "GOPATH=/home/runner/go" >> "$GITHUB_ENV"
echo "PATH=$PATH:/home/runner/go/bin" >> "$GITHUB_ENV"
- name: Clean out go cache
run: go clean -cache && go clean -modcache
- name: Checkout codebase
uses: actions/checkout@v4
- name: Install goa
run: go install goa.design/goa/v3/cmd/goa@v3
- name: Generate Server, CLI and Service definitions
run: goa gen github.com/t-hale/stox/design
run: bazel build //:goagen --action_env=GOCACHE=${HOME}/.cache --action_env=GOPATH=${GOPATH} --spawn_strategy=local
- name: Run gazelle to generate BUILD files
run: bazel run //:gazelle
run: |
bazel run //:gazelle --action_env=GOCACHE=${HOME}/.cache --action_env=GOPATH=${GOPATH}
git status
git diff
- name: Build the stox service
run: bazel build :stox
run: |
echo ${GOPATH}
echo ${GOCACHE}
bazel build --verbose_failures :stox --action_env=GOCACHE=${HOME}/.cache --action_env=GOPATH=${GOPATH}
- name: Run unit tests
run: bazel run :stox_test
run: bazel run :stox_test --action_env=GOCACHE=${HOME}/.cache --action_env=GOPATH=${GOPATH}
37 changes: 10 additions & 27 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,16 @@ go_library(
],
)

#genrule(
# name = "goagen",
# # srcs = [
# # "//design:goafiles",
# # ],
# outs = [
# "gen/http/cli/server/cli.go",
# "gen/http/openapi.json",
# "gen/http/openapi.yaml",
# "gen/http/openapi3.json",
# "gen/http/openapi3.yaml",
# "gen/http/stox/client/cli.go",
# "gen/http/stox/client/client.go",
# "gen/http/stox/client/encode_decode.go",
# "gen/http/stox/client/paths.go",
# "gen/http/stox/client/types.go",
# "gen/http/stox/server/encode_decode.go",
# "gen/http/stox/server/paths.go",
# "gen/http/stox/server/server.go",
# "gen/http/stox/server/types.go",
# "gen/log/logger.go",
# "gen/stox/client.go",
# "gen/stox/endpoints.go",
# "gen/stox/service.go",
# ],
# cmd = "goa gen github.com/t-hale/stox/design",
#)
genrule(
name = "goagen",
srcs = [
"//design:goafiles",
],
outs = [
"out.txt",
],
cmd = "goa gen github.com/t-hale/stox/design > $@",
)

gazelle(
name = "gazelle-update-repos",
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ bazel_dep(name = "gazelle", version = "0.34.0", repo_name = "bazel_gazelle")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(go_deps, "com_github_alpacahq_alpaca_trade_api_go_v3", "com_github_golang_protobuf", "com_github_google_go_cmp", "com_github_polygon_io_client_go", "com_github_rs_zerolog", "design_goa_goa_v3", "design_goa_plugins_v3", "org_golang_google_protobuf")
use_repo(go_deps, "com_github_alpacahq_alpaca_trade_api_go_v3", "com_github_golang_protobuf", "com_github_google_go_cmp", "com_github_polygon_io_client_go", "com_github_rs_zerolog", "design_goa_goa", "design_goa_goa_v3", "design_goa_plugins_v3", "org_golang_google_protobuf")
43 changes: 40 additions & 3 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/polygon-io/client-go v1.13.1
github.com/rs/zerolog v1.29.1
goa.design/goa v2.2.5+incompatible
goa.design/goa/v3 v3.11.3
goa.design/plugins/v3 v3.11.3
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -40,6 +41,7 @@ require (
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea h1:CyhwejzVGvZ3Q2PSbQ4NRRYn+ZWv5eS1vlaEusT+bAI=
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea/go.mod h1:eNr558nEUjP8acGw8FFjTeWvSgU1stO7FAO6eknhHe4=
goa.design/goa v2.2.5+incompatible h1:mjAtiy7ZdZIkj974hpFxCR6bL69qprfV00Veu3Vybts=
goa.design/goa v2.2.5+incompatible/go.mod h1:NnzBwdNktihbNek+pPiFMQP9PPFsUt8MMPPyo9opDSo=
goa.design/goa/v3 v3.11.3 h1:lbFYco2+T1Rq8V242mO1kMeQEbsJ5MNnWJaTdLpX9ug=
goa.design/goa/v3 v3.11.3/go.mod h1:3wY9Kv5/glhT4n5i1EE6qYL9TQpbta1MGtFSbkMXAUM=
goa.design/plugins/v3 v3.11.3 h1:NVs2L48KZEB0M+G437Z8vbHR2c3kQ9u5LsbzlkSY9CU=
Expand All @@ -107,6 +109,7 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
Expand All @@ -115,6 +118,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down

0 comments on commit b12cf22

Please sign in to comment.