Skip to content

Pin actions (#577)

Pin actions (#577) #85

name: Unit Tests And Build
on:
pull_request_review:
types:
- submitted
push:
branches:
- main
permissions:
contents: read
jobs:
test-and-build:
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(
github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved'
)
runs-on: ubuntu-latest
env:
GOTOOLCHAIN: local
CGO_ENABLED: 1
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event_name == 'pull_request_review' && github.event.pull_request.head.sha || github.sha }}
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
cache: true
- name: Build exporter
run: make go-build
- name: Run tests
run: make go-test