Skip to content

Algo: Introduce support for pods metric query as workload external query & other tweaks #76

Algo: Introduce support for pods metric query as workload external query & other tweaks

Algo: Introduce support for pods metric query as workload external query & other tweaks #76

Workflow file for this run

name: CI
on:
pull_request:
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: Run linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files_yaml: |
go:
- '**/*.go'
- name: Set up Go
if: steps.changed-files.outputs.go_any_changed == 'true'
uses: actions/setup-go@v4
with:
go-version: "1.19"
cache: false
- name: Run golangci-lint
if: steps.changed-files.outputs.go_any_changed == 'true'
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
# TODO(zqzten): add verify job
test:
name: Run unit tests
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files_yaml: |
go:
- '**/*.go'
- go.mod
- go.sum
- Makefile
- name: Git config
if: steps.changed-files.outputs.go_any_modified == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Rebase code
if: steps.changed-files.outputs.go_any_modified == 'true'
run: git rebase origin/main
- name: Set up Go
if: steps.changed-files.outputs.go_any_modified == 'true'
uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: Run unit tests
if: steps.changed-files.outputs.go_any_modified == 'true'
run: make unit-test