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'
|
|
|
|
- '.github/workflows/build.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
|
2022-09-22 21:00:05 +02:00
|
|
|
with:
|
|
|
|
cache: true
|
2022-11-02 19:19:01 +02:00
|
|
|
go-version: '>=1.19.3'
|
2022-09-11 20:32:23 +02:00
|
|
|
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:
|
|
|
|
cache: true
|
2022-11-02 19:19:01 +02:00
|
|
|
go-version: '>=1.19.3'
|
2022-09-22 21:00:05 +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:
|
2022-12-13 14:44:45 +02:00
|
|
|
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3
|
2020-06-16 14:37:11 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-13 00:04:36 +02:00
|
|
|
- uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # 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
|
2022-10-19 14:53:41 +02:00
|
|
|
- uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # 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
|
2022-12-02 14:09:52 +02:00
|
|
|
- uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3
|
2020-05-10 22:08:36 +02:00
|
|
|
with:
|
2022-11-02 19:19:01 +02:00
|
|
|
go-version: '>=1.19.3'
|
2022-09-09 16:36:15 +02:00
|
|
|
cache: true
|
2022-10-19 14:54:06 +02:00
|
|
|
- uses: sigstore/cosign-installer@v2.8.1
|
2022-11-07 14:11:22 +02:00
|
|
|
- uses: anchore/sbom-action/download-syft@v0.13.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
|
2022-09-20 15:15:30 +02:00
|
|
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # 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
|