2020-05-10 22:08:36 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-06-22 00:09:27 +02:00
|
|
|
- "main"
|
2020-05-10 22:08:36 +02:00
|
|
|
pull_request:
|
2022-09-20 04:48:20 +02:00
|
|
|
paths:
|
2023-06-22 00:09:27 +02:00
|
|
|
- "go.*"
|
|
|
|
- "**/*.go"
|
|
|
|
- "Taskfile.yml"
|
|
|
|
- "Dockerfile"
|
|
|
|
- ".github/workflows/*.yml"
|
2020-05-10 22:08:36 +02:00
|
|
|
|
2021-12-16 18:43:11 +02:00
|
|
|
permissions:
|
2022-09-19 02:31:33 +02:00
|
|
|
contents: read
|
2021-12-16 18:43:11 +02:00
|
|
|
|
2020-05-10 22:08:36 +02:00
|
|
|
jobs:
|
2022-09-09 16:36:15 +02:00
|
|
|
govulncheck:
|
2022-09-11 20:32:23 +02:00
|
|
|
uses: caarlos0/meta/.github/workflows/govulncheck.yml@main
|
|
|
|
semgrep:
|
|
|
|
uses: caarlos0/meta/.github/workflows/semgrep.yml@main
|
|
|
|
ruleguard:
|
|
|
|
uses: caarlos0/meta/.github/workflows/ruleguard.yml@main
|
2022-09-22 21:00:05 +02:00
|
|
|
with:
|
2023-06-22 00:09:27 +02:00
|
|
|
args: "-disable largeloopcopy"
|
2022-09-19 02:31:33 +02:00
|
|
|
test:
|
2020-05-10 22:08:36 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-28 21:26:37 +02:00
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
2020-05-10 22:08:36 +02:00
|
|
|
steps:
|
2023-08-26 20:31:13 +02:00
|
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
2020-06-16 14:37:11 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-01 14:19:19 +02:00
|
|
|
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
|
2021-10-13 01:14:15 +02:00
|
|
|
with:
|
2021-11-14 16:54:31 +02:00
|
|
|
version: 3.x
|
2021-10-13 01:14:15 +02:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-08 14:10:29 +02:00
|
|
|
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
|
2023-07-21 18:58:14 +02:00
|
|
|
- uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2
|
2021-11-14 16:54:31 +02:00
|
|
|
- name: setup-snapcraft
|
2021-03-19 13:48:37 +02:00
|
|
|
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
|
2020-05-10 23:52:25 +02:00
|
|
|
run: |
|
2021-01-04 18:02:44 +02:00
|
|
|
sudo apt-get update
|
2020-05-10 23:52:25 +02:00
|
|
|
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
|
2021-03-19 13:48:37 +02:00
|
|
|
mkdir -p $HOME/.cache/snapcraft/download
|
|
|
|
mkdir -p $HOME/.cache/snapcraft/stage-packages
|
2023-05-03 19:06:40 +02:00
|
|
|
- uses: crazy-max/ghaction-upx@v2
|
|
|
|
with:
|
|
|
|
install-only: true
|
2023-06-19 13:59:24 +02:00
|
|
|
- uses: cachix/install-nix-action@v22
|
2023-05-26 04:07:10 +02:00
|
|
|
with:
|
|
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-09 15:14:03 +02:00
|
|
|
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
|
2020-05-10 22:08:36 +02:00
|
|
|
with:
|
2023-03-17 05:40:25 +02:00
|
|
|
go-version: stable
|
2023-06-28 14:46:15 +02:00
|
|
|
- uses: sigstore/cosign-installer@v3.1.1
|
2023-06-21 21:13:11 +02:00
|
|
|
- uses: anchore/sbom-action/download-syft@v0.14.3
|
2021-11-14 16:54:31 +02:00
|
|
|
- name: setup-validate-krew-manifest
|
2022-04-14 04:00:29 +02:00
|
|
|
run: go install sigs.k8s.io/krew/cmd/validate-krew-manifest@latest
|
2022-06-12 04:25:04 +02:00
|
|
|
- name: setup-tparse
|
|
|
|
run: go install github.com/mfridman/tparse@latest
|
|
|
|
- name: setup
|
|
|
|
run: |
|
|
|
|
task setup
|
|
|
|
task build
|
|
|
|
- name: test
|
2022-06-24 14:33:34 +02:00
|
|
|
run: ./scripts/test.sh
|
2023-05-16 14:22:03 +02:00
|
|
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3
|
2020-05-10 23:52:25 +02:00
|
|
|
with:
|
|
|
|
file: ./coverage.txt
|
2021-11-14 16:54:31 +02:00
|
|
|
- run: ./goreleaser check
|
|
|
|
- run: git diff
|