Skip to content

GO CI

GO CI #201

Workflow file for this run

name: GO CI
on:
push:
paths:
- 'golang/**'
- '.github/workflows/go**'
pull_request:
paths:
- 'golang/**'
- '.github/workflows/go**'
schedule:
# weekly build every FRI
- cron: "0 6 * * 5"
jobs:
matrix_build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, macOS-latest, windows-latest ]
go: [ '1.14', '1.13', '1.12' ]
name: Go ${{ matrix.go }} Build on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v2.2.0
with:
go-version: ${{ matrix.go }}
- name: cache go
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
#### BEGIN testify
- name: run with testify
working-directory: golang/testify
run: |
go mod tidy
go test kata_test.go -v -run TestGen
go test kata_test.go -v -run TestSomething
- name: assure one failing test
working-directory: golang/testify
run: "sh ../../.scripts/assure_failing_test.sh 'go test kata_test.go -v' 'Error Trace: kata_test.go:9'"
#### END testify
#### BEGIN testify test doubles
- name: run with testify
working-directory: golang/testify
run: |
go mod tidy
go test testdoubles_test.go -v -run TestStubIsReturningTrue
go test testdoubles_test.go -v -run TestMockIsCalledWith42
- name: assure one failing test
working-directory: golang/testify
run: "sh ../../.scripts/assure_failing_test.sh 'go test testdoubles_test.go -v -run TestMockIsFailingWhenNotCalledWith42' 'mock: Unexpected Method Call'"
#### END testify test doubles
#### BEGIN ginkgo
- name: run with ginkgo
working-directory: golang/ginkgo
run: go mod tidy
- name: run with ginkgo passing test
working-directory: golang/ginkgo
# no idea how to just run the passing test with ginkgo, therefore this hack:
run: "sh ../../.scripts/assure_failing_test.sh 'go test' '1 Passed'"
- name: assure one failing test
working-directory: golang/ginkgo
run: "sh ../../.scripts/assure_failing_test.sh 'go test' 'Summarizing 1 Failure:'"
#### END ginkgo