Fix linting and VSCode config #41
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| backend-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| cache: false | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.7.1 | |
| working-directory: backend | |
| backend-migration-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Atlas | |
| uses: ariga/setup-atlas@v0 | |
| with: | |
| version: latest | |
| - name: Validate migration directory | |
| run: atlas migrate validate --dir "file://backend/ent/migrate/migrations" | |
| - name: Verify migration hash integrity | |
| run: | | |
| atlas migrate hash --dir "file://backend/ent/migrate/migrations" | |
| git diff --exit-code -- backend/ent/migrate/migrations/atlas.sum | |
| backend-test: | |
| needs: [backend-lint, backend-migration-lint] | |
| runs-on: ubuntu-latest | |
| container: | |
| image: golang:1.25-alpine | |
| env: | |
| GOMODCACHE: ${{ github.workspace }}/.pkg/mod | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: .pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Install build dependencies | |
| run: apk add --no-cache git build-base | |
| - name: Get dependencies | |
| working-directory: ./backend | |
| run: go mod download | |
| - name: Run tests | |
| working-directory: ./backend | |
| run: go test ./... | |
| frontend-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Run linting | |
| working-directory: ./frontend | |
| run: npm run lint | |
| frontend-test: | |
| needs: frontend-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| working-directory: ./frontend | |
| - name: Run unit tests | |
| working-directory: ./frontend | |
| run: npm run test:unit -- --run |