Skip to content

CI tester

CI tester #54

Workflow file for this run

name: CI Test
on:
push:
branches:
- main
pull_request:
jobs:
ci-test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"
cache: true
- name: Cache dependencies
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Run Test Suite
run: set -o pipefail && go test ./... -coverpkg=./... -coverprofile=coverage.txt
- name: Run Race Test Suite
run: set -o pipefail && go test -race ./... -coverpkg=./... -coverprofile=race_coverage.txt
- name: Upload Go test results
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: go-test-results
path: |
./coverage.txt
./race_coverage.txt
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ci-test
continue-on-error: true