run tests on push or PR

This commit is contained in:
Serge Smertin 2022-05-16 13:02:12 +02:00
parent 1b38687e2d
commit bf801c2605
4 changed files with 54 additions and 2 deletions

47
.github/workflows/push.yml vendored Normal file
View File

@ -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
.gitignore vendored
View File

@ -14,4 +14,7 @@ bricks
# Dependency directories (remove the comment below to include it) # Dependency directories (remove the comment below to include it)
vendor/ vendor/
dist/ dist/
*.log
coverage.txt

View File

@ -1,5 +1,7 @@
# Bricks! # 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! This is an early PoC at this stage!
`make build` (or [download the latest from releases page](https://github.com/databricks/bricks/releases)). `make build` (or [download the latest from releases page](https://github.com/databricks/bricks/releases)).

View File

@ -65,7 +65,7 @@ func (p *Project) IsDevClusterJustReference() bool {
if p.DevCluster.ClusterName == "" { if p.DevCluster.ClusterName == "" {
return false return false
} }
return reflect.DeepEqual(p.DevCluster, clusters.Cluster{ return reflect.DeepEqual(p.DevCluster, &clusters.Cluster{
ClusterName: p.DevCluster.ClusterName, ClusterName: p.DevCluster.ClusterName,
}) })
} }