feat(frontend): show workspace name in sidebar #585
Workflow file for this run
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: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'components/frontend/**' | |
| - 'components/backend/**' | |
| - 'components/operator/**' | |
| - 'components/ambient-api-server/**' | |
| - 'components/ambient-cli/**' | |
| - '.github/workflows/lint.yml' | |
| - '!**/*.md' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'components/frontend/**' | |
| - 'components/backend/**' | |
| - 'components/operator/**' | |
| - 'components/ambient-api-server/**' | |
| - 'components/ambient-cli/**' | |
| - '.github/workflows/lint.yml' | |
| - '!**/*.md' | |
| workflow_dispatch: | |
| concurrency: | |
| group: lint-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| frontend: ${{ steps.filter.outputs.frontend }} | |
| backend: ${{ steps.filter.outputs.backend }} | |
| operator: ${{ steps.filter.outputs.operator }} | |
| api-server: ${{ steps.filter.outputs.api-server }} | |
| cli: ${{ steps.filter.outputs.cli }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Detect changed components | |
| uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| frontend: | |
| - 'components/frontend/**/*.ts' | |
| - 'components/frontend/**/*.tsx' | |
| - 'components/frontend/**/*.js' | |
| - 'components/frontend/**/*.jsx' | |
| - 'components/frontend/package.json' | |
| - 'components/frontend/package-lock.json' | |
| - 'components/frontend/tsconfig.json' | |
| - 'components/frontend/eslint.config.mjs' | |
| backend: | |
| - 'components/backend/**/*.go' | |
| - 'components/backend/go.mod' | |
| - 'components/backend/go.sum' | |
| operator: | |
| - 'components/operator/**/*.go' | |
| - 'components/operator/go.mod' | |
| - 'components/operator/go.sum' | |
| api-server: | |
| - 'components/ambient-api-server/**/*.go' | |
| - 'components/ambient-api-server/go.mod' | |
| - 'components/ambient-api-server/go.sum' | |
| cli: | |
| - 'components/ambient-cli/**/*.go' | |
| - 'components/ambient-cli/go.mod' | |
| - 'components/ambient-cli/go.sum' | |
| frontend: | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.frontend == 'true' || github.event_name == 'workflow_dispatch' | |
| name: Frontend Lint and Type Check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: 'components/frontend/package.json' | |
| cache: 'npm' | |
| cache-dependency-path: 'components/frontend/package-lock.json' | |
| - name: Install dependencies | |
| run: | | |
| cd components/frontend | |
| npm ci | |
| - name: Run ESLint | |
| run: | | |
| cd components/frontend | |
| npm run lint | |
| - name: Run TypeScript type check | |
| run: | | |
| cd components/frontend | |
| npx tsc --noEmit | |
| - name: Build check | |
| run: | | |
| cd components/frontend | |
| npm run build | |
| go-backend: | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.backend == 'true' || github.event_name == 'workflow_dispatch' | |
| name: Go Lint - Backend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'components/backend/go.mod' | |
| cache-dependency-path: 'components/backend/go.sum' | |
| - name: Check gofmt | |
| run: | | |
| cd components/backend | |
| UNFORMATTED=$(gofmt -l .) | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "The following files are not formatted:" | |
| echo "$UNFORMATTED" | |
| echo "" | |
| echo "Run 'gofmt -w .' to format them." | |
| exit 1 | |
| fi | |
| - name: Run go vet | |
| run: | | |
| cd components/backend | |
| go vet ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| working-directory: components/backend | |
| args: --timeout=5m | |
| - name: Run golangci-lint (test build tags) | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| working-directory: components/backend | |
| args: --timeout=5m --build-tags=test | |
| go-operator: | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.operator == 'true' || github.event_name == 'workflow_dispatch' | |
| name: Go Lint - Operator | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'components/operator/go.mod' | |
| cache-dependency-path: 'components/operator/go.sum' | |
| - name: Check gofmt | |
| run: | | |
| cd components/operator | |
| UNFORMATTED=$(gofmt -l .) | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "The following files are not formatted:" | |
| echo "$UNFORMATTED" | |
| echo "" | |
| echo "Run 'gofmt -w .' to format them." | |
| exit 1 | |
| fi | |
| - name: Run go vet | |
| run: | | |
| cd components/operator | |
| go vet ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| working-directory: components/operator | |
| args: --timeout=5m | |
| go-api-server: | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.api-server == 'true' || github.event_name == 'workflow_dispatch' | |
| name: Go Lint - API Server | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'components/ambient-api-server/go.mod' | |
| cache-dependency-path: 'components/ambient-api-server/go.sum' | |
| - name: Check gofmt | |
| run: | | |
| cd components/ambient-api-server | |
| UNFORMATTED=$(gofmt -l .) | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "The following files are not formatted:" | |
| echo "$UNFORMATTED" | |
| echo "" | |
| echo "Run 'gofmt -w .' to format them." | |
| exit 1 | |
| fi | |
| - name: Run go vet | |
| run: | | |
| cd components/ambient-api-server | |
| go vet ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| working-directory: components/ambient-api-server | |
| args: --timeout=5m | |
| go-cli: | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.cli == 'true' || github.event_name == 'workflow_dispatch' | |
| name: Go Lint - CLI | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'components/ambient-cli/go.mod' | |
| cache-dependency-path: 'components/ambient-cli/go.sum' | |
| - name: Check gofmt | |
| run: | | |
| cd components/ambient-cli | |
| UNFORMATTED=$(gofmt -l .) | |
| if [ -n "$UNFORMATTED" ]; then | |
| echo "The following files are not formatted:" | |
| echo "$UNFORMATTED" | |
| echo "" | |
| echo "Run 'gofmt -w .' to format them." | |
| exit 1 | |
| fi | |
| - name: Run go vet | |
| run: | | |
| cd components/ambient-cli | |
| go vet ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| working-directory: components/ambient-cli | |
| args: --timeout=5m | |
| summary: | |
| runs-on: ubuntu-latest | |
| needs: [detect-changes, frontend, go-backend, go-operator, go-api-server, go-cli] | |
| if: always() | |
| steps: | |
| - name: Check overall status | |
| run: | | |
| failed=false | |
| for result in \ | |
| "${{ needs.frontend.result }}" \ | |
| "${{ needs.go-backend.result }}" \ | |
| "${{ needs.go-operator.result }}" \ | |
| "${{ needs.go-api-server.result }}" \ | |
| "${{ needs.go-cli.result }}"; do | |
| if [ "$result" == "failure" ] || [ "$result" == "cancelled" ]; then | |
| failed=true | |
| fi | |
| done | |
| if [ "$failed" == "true" ]; then | |
| echo "Linting failed" | |
| echo " frontend: ${{ needs.frontend.result }}" | |
| echo " go-backend: ${{ needs.go-backend.result }}" | |
| echo " go-operator: ${{ needs.go-operator.result }}" | |
| echo " go-api-server: ${{ needs.go-api-server.result }}" | |
| echo " go-cli: ${{ needs.go-cli.result }}" | |
| exit 1 | |
| fi | |
| echo "All lint checks passed!" |