test automatic rebuild #190
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
# SPDX-FileCopyrightText: Copyright 2024 Prasad Tengse | |
# SPDX-License-Identifier: MIT | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: build | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
test: | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- macos-latest | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
- windows-2022 | |
- windows-2019 | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Install Task | |
run: go install github.com/go-task/task/v3/cmd/task@latest | |
- name: Test | |
run: task --verbose test | |
env: | |
DEBUG: 1 | |
- name: Compile Example Go Binary | |
working-directory: examples/go-autotune | |
run: go build -o go-autotune.exe ./ | |
- name: Init trace Example Go Binary | |
working-directory: examples/go-autotune | |
run: ./go-autotune.exe | |
env: | |
GODEBUG: inittrace=1 | |
- name: Coverage View Percent | |
run: go tool covdata percent -i .gocover | |
- uses: actions/upload-artifact@v4 | |
id: coverage-artifact | |
with: | |
name: ${{ format('go-coverage-{0}', matrix.runs-on) }} | |
path: .gocover | |
retention-days: 30 | |
# Generate coverage profile from all coverage data. | |
coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Download and merge coverage data | |
uses: actions/download-artifact@v4 | |
with: | |
path: .gocover | |
pattern: go-coverage-* | |
merge-multiple: true | |
- name: Create Coverage Profile | |
run: go tool covdata textfmt -i .gocover -o .gocover/coverage.out | |
- name: Create Coverage Profile (HTML) | |
run: go tool cover -html .gocover/coverage.out -o .gocover/coverage.html | |
- name: Coverage View Percent | |
run: go tool covdata percent -i .gocover | |
- name: View Coverage Profile | |
run: go tool cover -func .gocover/coverage.out | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: .gocover | |
retention-days: 30 | |
example: | |
needs: | |
- test | |
permissions: | |
attestations: write | |
packages: write | |
id-token: write | |
actions: read | |
contents: read | |
uses: ./.github/workflows/example.yml | |
with: | |
image-name: ${{ vars.EXAMPLE_IMAGE }} | |
image-push: ${{ github.event_name == 'push' && github.ref_name == 'sbom-update-1' }} | |
image-tag-latest: ${{ github.ref_name == github.event.repository.default_branch }} |