Skip to content

refactor: extract queries in resources/cluster to allow override #1038

refactor: extract queries in resources/cluster to allow override

refactor: extract queries in resources/cluster to allow override #1038

Workflow file for this run

name: ci
permissions: {}
on:
push:
branches:
- master
pull_request:
jobs:
build-tools:
runs-on: ubuntu-latest
name: Build Go Tools
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: scripts/go.mod
cache-dependency-path: scripts/go.sum
- name: Build Go tools
run: |
mkdir -p tmp/bin
cd scripts && go list -e -mod=mod -tags tools -f '{{ range .Imports }}{{ printf "%s\n" .}}{{end}}' ./ | xargs -tI % go build -mod=mod -o ../tmp/bin %
- name: Upload built tools
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: go-tools
path: tmp/bin/
retention-days: 1
if-no-files-found: error
matrix:
runs-on: ubuntu-latest
name: ${{ matrix.name }}
needs: build-tools
strategy:
fail-fast: false
matrix:
include:
- name: Lint Alerts
run: make alerts-lint
- name: Generate YAML
run: make generate && git diff --exit-code
- name: Lint Grafana Dashboards
run: make dashboards-lint
- name: Format JSONNET
run: make jsonnet-fmt && git diff --exit-code
- name: Lint JSONNET
run: make jsonnet-lint
- name: Format MD
run: make markdownfmt && git diff --exit-code
- name: Lint MD
run: make vale && git diff --exit-code
- name: Lint YAML
run: make pint-lint
- name: Run unit tests
run: make test
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Download built tools
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: go-tools
path: tmp/bin/
- name: Make tools executable and update timestamps
run: |
chmod +x tmp/bin/*
touch tmp/bin/*
- run: ${{ matrix.run }}