Skip to content

Commit

Permalink
chore(ci): setup go test workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Lam Tran <[email protected]>
  • Loading branch information
tranngoclam authored and Lam Tran committed Oct 31, 2023
1 parent 7d27633 commit 9642ac4
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 7 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,33 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Test
test-bazel:
name: Test (Bazel)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v2
- uses: actions/cache@v3
with:
path: "~/.cache/bazel"
key: bazel
- run: bazelisk test //... --test_output=errors

test-go:
name: Test (Go)
runs-on: ubuntu-latest
strategy:
matrix:
dir: [api, bar, foo, lib]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: ${{ matrix.dir }}/go.mod
- run: go test -v ./...
working-directory: ${{ matrix.dir }}
12 changes: 12 additions & 0 deletions .ijwb/.bazelproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is a projectview file generated automatically during bazel project auto-import
# For more documentation, please visit https://ij.bazel.build/docs/project-views.html
# If your repository contains predefined .projectview files, you use 'import' directive to include them.
# Otherwise, please specify 'directories' and 'targets' you want to be imported
#
# By default we keep your 'directories' and 'targets' sections empty, so nothing is imported.
# Please uncomment them and put the correct data there, and then run 'Sync' again

# directories:
# <your directory here>
# targets:
# <your directory here>
11 changes: 11 additions & 0 deletions .ijwb/.blaze/modules/.project-data-dir.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="Blaze" type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/.." />
<excludeFolder url="file://$MODULE_DIR$/../../.idea" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
8 changes: 8 additions & 0 deletions .ijwb/.blaze/modules/.workspace.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="Blaze" type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module api

go 1.20
go 1.21

require google.golang.org/protobuf v1.30.0
2 changes: 1 addition & 1 deletion bar/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module bar

go 1.20
go 1.21

require github.com/gorilla/mux v1.8.0
2 changes: 1 addition & 1 deletion foo/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module foo

go 1.20
go 1.21

require github.com/stretchr/testify v1.8.2

Expand Down
2 changes: 1 addition & 1 deletion lib/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module lib

go 1.20
go 1.21

require github.com/stretchr/testify v1.8.2

Expand Down

0 comments on commit 9642ac4

Please sign in to comment.