2020-05-10 22:08:36 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-11-12 17:23:32 -03:00
|
|
|
- 'main'
|
2020-05-10 22:08:36 +02:00
|
|
|
pull_request:
|
2022-09-19 23:48:20 -03:00
|
|
|
paths:
|
|
|
|
- 'go.*'
|
|
|
|
- '**/*.go'
|
|
|
|
- 'Taskfile.yml'
|
|
|
|
- 'Dockerfile'
|
2023-02-07 09:48:26 -03:00
|
|
|
- '.github/workflows/*.yml'
|
2020-05-10 22:08:36 +02:00
|
|
|
|
2021-12-16 13:43:11 -03:00
|
|
|
permissions:
|
2022-09-18 21:31:33 -03:00
|
|
|
contents: read
|
2021-12-16 13:43:11 -03:00
|
|
|
|
2020-05-10 22:08:36 +02:00
|
|
|
jobs:
|
2022-09-09 11:36:15 -03:00
|
|
|
govulncheck:
|
2022-09-11 15:32:23 -03:00
|
|
|
uses: caarlos0/meta/.github/workflows/govulncheck.yml@main
|
2022-09-22 16:00:05 -03:00
|
|
|
with:
|
|
|
|
cache: true
|
2023-03-09 08:24:20 -03:00
|
|
|
go-version: '>=1.20.2'
|
2022-09-11 15:32:23 -03:00
|
|
|
semgrep:
|
|
|
|
uses: caarlos0/meta/.github/workflows/semgrep.yml@main
|
|
|
|
ruleguard:
|
|
|
|
uses: caarlos0/meta/.github/workflows/ruleguard.yml@main
|
2022-09-22 16:00:05 -03:00
|
|
|
with:
|
|
|
|
cache: true
|
2023-03-09 08:24:20 -03:00
|
|
|
go-version: '>=1.20.2'
|
2022-09-22 16:00:05 -03:00
|
|
|
args: '-disable largeloopcopy'
|
2022-09-18 21:31:33 -03:00
|
|
|
test:
|
2020-05-10 22:08:36 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-28 16:26:37 -03:00
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
2020-05-10 22:08:36 +02:00
|
|
|
steps:
|
2023-01-06 09:20:17 -03:00
|
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
2020-06-16 09:37:11 -03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-01 09:19:19 -03:00
|
|
|
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
|
2021-10-12 20:14:15 -03:00
|
|
|
with:
|
2021-11-14 11:54:31 -03:00
|
|
|
version: 3.x
|
2021-10-12 20:14:15 -03:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-13 10:52:43 -03:00
|
|
|
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2
|
2023-02-07 14:07:51 +00:00
|
|
|
- uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2
|
2021-11-14 11:54:31 -03:00
|
|
|
- name: setup-snapcraft
|
2021-03-19 08:48:37 -03: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 13:02:44 -03: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 08:48:37 -03:00
|
|
|
mkdir -p $HOME/.cache/snapcraft/download
|
|
|
|
mkdir -p $HOME/.cache/snapcraft/stage-packages
|
2022-12-14 12:09:30 -03:00
|
|
|
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3
|
2020-05-10 22:08:36 +02:00
|
|
|
with:
|
2023-03-09 08:24:20 -03:00
|
|
|
go-version: '>=1.20.2'
|
2022-09-09 11:36:15 -03:00
|
|
|
cache: true
|
2023-03-02 09:36:26 -03:00
|
|
|
- uses: sigstore/cosign-installer@v3.0.1
|
2023-01-27 08:55:18 -03:00
|
|
|
- uses: anchore/sbom-action/download-syft@v0.13.3
|
2021-11-14 11:54:31 -03:00
|
|
|
- name: setup-validate-krew-manifest
|
2022-04-13 23:00:29 -03:00
|
|
|
run: go install sigs.k8s.io/krew/cmd/validate-krew-manifest@latest
|
2022-06-11 23:25:04 -03:00
|
|
|
- name: setup-tparse
|
|
|
|
run: go install github.com/mfridman/tparse@latest
|
|
|
|
- name: setup
|
|
|
|
run: |
|
|
|
|
task setup
|
|
|
|
task build
|
|
|
|
- name: test
|
2022-06-24 09:33:34 -03:00
|
|
|
run: ./scripts/test.sh
|
2022-09-20 10:15:30 -03:00
|
|
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3
|
2020-05-10 23:52:25 +02:00
|
|
|
with:
|
|
|
|
file: ./coverage.txt
|
2021-11-14 11:54:31 -03:00
|
|
|
- run: ./goreleaser check
|
|
|
|
- run: git diff
|