Skip to content

Add lint/tidy for all subprojects in a matrix #3716

Add lint/tidy for all subprojects in a matrix

Add lint/tidy for all subprojects in a matrix #3716

Workflow file for this run

name: (all packages) Unit tests
on:
push:
tags:
- v*
pull_request:
jobs:
unit:
strategy:
fail-fast: false
matrix:
project:
- name: root
path: ./
- name: gotestloghelper
path: ./tools/gotestloghelper/
runs-on: ubuntu-latest
name: ${{ matrix.project.name }} unit tests
steps:
- name: Checkout the Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@00c6214deb10a3f374c6d3430c32c5202015d463 # v2.2.12
with:
test_download_vendor_packages_command: go mod download
go_mod_path: ${{ matrix.project.path }}go.mod
cache_key_id: ctf-go
cache_restore_only: 'false'
- name: Install gotestloghelper
run: make gotestloghelper_build
- name: Run Tests
run: |
PATH=$PATH:$(go env GOPATH)/bin
export PATH
set -euo pipefail
# disabled, because we want to use a multiline output of go list command
# shellcheck disable=SC2046
cd ${{ matrix.project.path }}
go test -timeout 5m -json -cover -covermode=count -coverprofile=unit-test-coverage.out $(go list ./... | grep -v /k8s/e2e/ | grep -v /k8s/examples/ | grep -v /docker/test_env) 2>&1 | tee /tmp/gotest.log | /home/runner/work/chainlink-testing-framework/chainlink-testing-framework/gotestloghelper -ci
- name: Code Coverage
uses: codecov/codecov-action@v3
with:
files: ./unit-test-coverage.out
name: codecov-umbrella
- name: Publish Artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-logs
path: /tmp/gotest.log