chore(ci): fix create_grafana_key in workflow (#1033) #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daisctl PRs | |
env: | |
WORKDIR: tools/daisctl | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
paths: | |
- "tools/daisctl/**/*.go" | |
- "tools/daisctl/go.*" | |
- "tools/daisctl/Makefile" | |
- "./github/workflows/daisctl-pr.yml" | |
jobs: | |
tidy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ env.WORKDIR }}/go.mod' | |
cache: true | |
- name: Check go mod | |
run: | | |
go mod tidy | |
git diff --exit-code go.mod | |
git diff --exit-code go.sum | |
lint: | |
needs: tidy | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ env.WORKDIR }}/go.mod' | |
cache: true | |
- name: lint | |
uses: golangci/golangci-lint-action@v6.1.1 | |
with: | |
version: latest | |
working-directory: ${{ env.WORKDIR }} | |
test: | |
needs: lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
shell: bash | |
test-cmd: make test | |
- os: macos-latest | |
shell: bash | |
test-cmd: make test | |
- os: windows-latest | |
shell: powershell | |
test-cmd: make.exe test | |
name: Test - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ env.WORKDIR }}/go.mod' | |
cache: true | |
- name: Run tests | |
run: ${{ matrix.test-cmd }} |