Skip to content

Commit

Permalink
run tests on push or PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx committed May 16, 2022
1 parent 1b38687 commit bf801c2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build

on:
pull_request:
types: [opened, synchronize]
push:
branches: [master]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16.x

- name: Cache packages
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
/opt/hostedtoolcache/go
vendor
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
go get gotest.tools/gotestsum
go install honnef.co/go/tools/cmd/staticcheck@v0.2.2
- name: Pull external libraries
run: make vendor

- name: Run tests
run: make test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ bricks

# Dependency directories (remove the comment below to include it)
vendor/
dist/
dist/

*.log
coverage.txt
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Bricks!

[![build](https://github.com/databricks/bricks/workflows/build/badge.svg?branch=main)](https://github.com/databricks/bricks/actions?query=workflow%3Abuild+branch%3Amain)

This is an early PoC at this stage!

`make build` (or [download the latest from releases page](https://github.com/databricks/bricks/releases)).
Expand Down
2 changes: 1 addition & 1 deletion project/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (p *Project) IsDevClusterJustReference() bool {
if p.DevCluster.ClusterName == "" {
return false
}
return reflect.DeepEqual(p.DevCluster, clusters.Cluster{
return reflect.DeepEqual(p.DevCluster, &clusters.Cluster{
ClusterName: p.DevCluster.ClusterName,
})
}
Expand Down

0 comments on commit bf801c2

Please sign in to comment.