vcluster platform config restructure #6196
This file contains hidden or 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: Lint | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - v* | |
| paths: | |
| - go.mod | |
| - go.sum | |
| - "**.go" | |
| - ".github/workflows/lint.yaml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| golangci: | |
| name: lint | |
| if: github.repository_owner == 'loft-sh' # do not run on forks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: ./go.mod | |
| cache: false | |
| - name: Generate Embedded Helm Chart | |
| run: | | |
| go generate ./... | |
| - name: Verify schema changes | |
| run: | | |
| VALUES_SHA=$(cat chart/values.yaml | sha256sum) | |
| VALUES_SCHEMA_SHA=$(cat chart/values.schema.json | sha256sum) | |
| go run hack/schema/main.go | |
| VALUES_SHA_AFTER=$(cat chart/values.yaml | sha256sum) | |
| VALUES_SCHEMA_SHA_AFTER=$(cat chart/values.schema.json | sha256sum) | |
| # if there are changes, tell developer to run script | |
| if [ "$VALUES_SHA" != "$VALUES_SHA_AFTER" ] || [ "$VALUES_SCHEMA_SHA" != "$VALUES_SCHEMA_SHA_AFTER" ]; then | |
| echo "Seems like you forgot to run 'go run hack/schema/main.go' before committing your changes!" | |
| exit 1 | |
| fi | |
| - name: Verify go mod tidy and vendor | |
| run: | | |
| go mod tidy | |
| go mod vendor | |
| if [ -n "$(git status --porcelain go.mod go.sum vendor/)" ]; then | |
| echo "❌ ERROR: go.mod, go.sum, or vendor/ directory is out of sync." | |
| echo "Please run 'go mod tidy && go mod vendor' and commit the changes." | |
| echo "" | |
| echo "Changed files:" | |
| git status --porcelain go.mod go.sum vendor/ | |
| echo "" | |
| echo "Diff (go.mod and go.sum):" | |
| git diff go.mod go.sum | |
| echo "" | |
| echo "💡 TIP: If this works locally but fails in CI, check for gitignored" | |
| echo " directories (e.g. licenses/) that may affect dependency resolution." | |
| echo " Run 'git status --ignored' locally to see ignored files." | |
| exit 1 | |
| fi | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.4 |