Init #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Workflow | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
unit_test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
container: | |
image: golang:1.21 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run unit tests | |
run: go test -v ./... | |
compile: | |
name: Build | |
runs-on: ubuntu-latest | |
container: | |
image: golang:1.21 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Compile Go application | |
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gauge-exporter -buildvcs=false -ldflags "-X main.appVersion=${{ github.ref_name }}" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gauge-exporter | |
path: gauge-exporter | |
retention-days: 1 | |