chore(deps): bump anchore/sbom-action from 0.15.2 to 0.15.5 #1171
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
--- | |
# based on https://github.com/mvdan/github-actions-golang | |
name: CI | |
on: | |
pull_request: | |
branches: ["main"] | |
paths-ignore: | |
- "config/version.txt" | |
- "README.md" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: "^1.20.6" | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
# cache go modules | |
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
# * Build cache (Mac) | |
# * Build cache (Windows) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
%LocalAppData%\go-build | |
bin | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Run linting | |
if: matrix.os == 'ubuntu-latest' | |
run: make lint | |
- name: Run unittest | |
if: matrix.os == 'ubuntu-latest' | |
run: make test-coverage | |
- name: Go Coverage Badge | |
uses: tj-actions/coverage-badge-go@v2 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
green: 80 | |
filename: out/coverage.out | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v17 | |
if: matrix.os == 'ubuntu-latest' | |
id: verify-changed-files-coverage | |
with: | |
files: README.md | |
- name: Commit changes | |
if: steps.verify-changed-files-coverage.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add README.md | |
git commit -m "chore(docs): update coverage badge" | |
- name: Build package | |
run: make build | |
- name: Execute build | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
run: ./out/bin/gt --help | |
- name: Execute build | |
if: matrix.os == 'windows-latest' | |
run: ./out/bin/gt.exe --help | |
- name: Create a test project & test it | |
run: | | |
make testing-project-default | |
make -C testing-project ci | |
make -C testing-project all | |
- name: Test generate projects | |
run: make testing-project-ci | |
- name: Run generate | |
if: matrix.os == 'ubuntu-latest' | |
run: make generate | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v17 | |
if: matrix.os == 'ubuntu-latest' | |
id: verify-changed-files-generate | |
with: | |
files: | | |
nix/gomod2nix.toml | |
docs/options.md | |
- name: Commit changes | |
if: steps.verify-changed-files-generate.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "opensource@mail.schwarz" | |
git config --local user.name "SchwarzIT Bot" | |
git add nix/gomod2nix.toml docs/options.md | |
git commit -m "chore: regenerate files" | |
- name: Push changes | |
if: steps.verify-changed-files-coverage.outputs.files_changed == 'true' || steps.verify-changed-files-generate.outputs.files_changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.SIT_BOT_PAT }} | |
branch: ${{ github.head_ref }} |