2020-05-10 22:08:36 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-11-12 22:23:32 +02:00
|
|
|
- 'main'
|
2020-05-10 22:08:36 +02:00
|
|
|
pull_request:
|
2022-09-20 04:48:20 +02:00
|
|
|
paths:
|
|
|
|
- 'go.*'
|
|
|
|
- '**/*.go'
|
|
|
|
- 'Taskfile.yml'
|
|
|
|
- 'Dockerfile'
|
2023-02-07 14:48:26 +02:00
|
|
|
- '.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:
|
|
|
|
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-05-02 14:24:53 +02:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # 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 }}
|
2022-10-13 15:52:43 +02:00
|
|
|
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2
|
2023-03-13 14:25:22 +02:00
|
|
|
- uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # 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-02 02:22:05 +02:00
|
|
|
- name: setup-upx
|
|
|
|
run: sudo apt-get -yq --no-install-suggests --no-install-recommends install upx-ucl
|
2023-03-17 05:40:25 +02:00
|
|
|
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4
|
2020-05-10 22:08:36 +02:00
|
|
|
with:
|
2023-03-17 05:40:25 +02:00
|
|
|
go-version: stable
|
2023-05-02 14:24:53 +02:00
|
|
|
- uses: sigstore/cosign-installer@v3.0.3
|
|
|
|
- uses: anchore/sbom-action/download-syft@v0.14.1
|
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-02 14:24:53 +02:00
|
|
|
- uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # 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
|