Implementing some more changes to the streamer #4
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: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 | |
goos: [linux, windows, darwin] | |
goarch: ["386", amd64, arm64] | |
exclude: | |
- goarch: "386" | |
goos: darwin | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go 1.21.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: ${{ github.workspace }}/src/go.mod | |
cache: true | |
cache-dependency-path: ${{ github.workspace }}/src/go.sum | |
- name: Install dependencies | |
working-directory: ${{ github.workspace }}/src | |
run: | | |
go get . | |
- name: Download modules | |
working-directory: ${{ github.workspace }}/src | |
run: | | |
go mod download | |
- name: Build | |
working-directory: ${{ github.workspace }}/src | |
run: go build -v ./... | |
test: | |
needs: build | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go 1.21.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: ${{ github.workspace }}/src/go.mod | |
cache: true | |
cache-dependency-path: ${{ github.workspace }}/src/go.sum | |
- name: Install dependencies | |
working-directory: ${{ github.workspace }}/src | |
run: | | |
go get . | |
- name: Test | |
working-directory: ${{ github.workspace }}/src | |
run: | | |
go install github.com/axw/gocov/gocov@latest | |
go install github.com/AlekSi/gocov-xml@latest | |
go install github.com/matm/gocov-html/cmd/gocov-html@latest | |
go test -coverprofile coverage.txt -covermode count -v ./... | |
gocov convert coverage.txt | gocov-xml > ../cobertura-coverage.xml | |
- name: Upload Code Coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: ${{ github.workspace }}/cobertura-coverage.xml | |
- name: Code Coverage Summary Report | |
uses: irongut/[email protected] | |
with: | |
filename: cobertura-coverage.xml | |
badge: true | |
fail_below_min: false | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: false | |
indicators: true | |
output: both | |
thresholds: "40 80" | |
- name: Add Coverage PR Comment | |
if: false | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
recreate: true | |
path: code-coverage-results.md | |
- name: Run Gosec Security Scanner | |
uses: securego/gosec@master | |
with: | |
args: "-no-fail -fmt sarif -out results.sarif ./..." | |
- name: Upload SARIF file | |
if: false | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: results.sarif | |
- name: Build Helm Chart | |
run: | | |
helm lint ./helm | |
make build-helm-chart |