52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Tests E2E
|
|
# Tests Race workflow runs unit tests with the race detector
|
|
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
- uses: technote-space/get-diff-action@v6.1.0
|
|
id: git_diff
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
**/go.mod
|
|
**/go.sum
|
|
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
- name: Build
|
|
if: env.GIT_DIFF
|
|
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build
|
|
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18
|
|
- uses: technote-space/get-diff-action@v6.1.0
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: e2e tests
|
|
if: env.GIT_DIFF
|
|
run: |
|
|
cd tests/e2e && go test ./... -mod=readonly -timeout 30m -race -tags='e2e'
|