Skip to content

feat(SPV-1169): mock TX generator #3401

feat(SPV-1169): mock TX generator

feat(SPV-1169): mock TX generator #3401

Workflow file for this run

# See more at: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: run-go-tests
env:
GO111MODULE: on
on:
pull_request:
branches:
- "*"
push:
branches:
- "*"
jobs:
yamllint:
name: Run yaml linter
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run yaml linter
uses: ibiqlik/[email protected]
asknancy:
name: Ask Nancy (check dependencies)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# GH Actions runner uses go1.20 by default, so we need to install our own version.
# https://github.com/github/codeql-action/issues/1842#issuecomment-1704398087
- name: Install Go from go.mod
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Write go list
run: go list -json -m all > go.list
- name: Ask Nancy
uses: sonatype-nexus-community/[email protected]
continue-on-error: true
error-lint:
name: error-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --config=./.golangci-lint.yml
style-lint:
name: style-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-style-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --config=./.golangci-style.yml
test:
needs: [yamllint, asknancy]
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: 6
- name: Cache code
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
'%LocalAppData%\go-build' # Build cache (Windows)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
- name: Run tests
run: make test-all-db-ci
- name: Update code coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)