Skip to content

(Breaking change) chore: change default target-branch to main #484

(Breaking change) chore: change default target-branch to main

(Breaking change) chore: change default target-branch to main #484

Workflow file for this run

name: ci
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3
with:
fetch-depth: 0
- name: shellcheck
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9 # v1.1.0
- name: Setup go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.3.0
with:
go-version-file: './go.mod'
check-latest: true
- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.9.4
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@8f67e590f2d095516493f017008adc464e63adb1 # v3.1.0
with:
install-only: true
- name: Install cosign
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # v2.6.0
- name: Install syft
uses: anchore/sbom-action/download-syft@06e109483e6aa305a2b2395eabae554e51530e1d # v0.13.1
- name: Install k8s Kind
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 # v1.3.0
with:
install_only: true
- name: Install tools
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
./setup.sh
- name: Test
run: |
./e2e-kind.sh
- name: Lint
run: |
go vet -v ./...
goimports -w -l .
go mod tidy
git diff --exit-code
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.0.0
- name: Build
run: |
set -o nounset
set -o pipefail
echo "Building snapshot..."
./build.sh
check-docs:
name: check-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3
with:
go-version-file: './go.mod'
check-latest: true
- name: generate docs
run: |
go build -o ct-bin ./ct/main.go
./ct-bin doc-gen
git_status="$(git status --porcelain)"
if [[ ${git_status} ]]; then
echo -e 'Documentation is outdated. Please update the docs\n'
echo "${git_status}"
exit 1
fi
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3
with:
go-version-file: './go.mod'
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3
with:
version: v1.48.0