Lint #85
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: tests | |
| on: | |
| push: | |
| pull_request: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| checks: write | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Run tests | |
| run: make test | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| preset: [simple, production] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Pre-build Docker images | |
| run: | | |
| go run ./cmd/fastad init --game-config tests/e2e/fastad_test.yaml --preset ${{ matrix.preset }} | |
| docker compose -f compose.yml build | |
| - name: Run E2E tests (${{ matrix.preset }} preset) | |
| run: go test -tags "e2e e2e_${{ matrix.preset }}" -v ./tests/e2e/... -timeout 15m | |
| - name: Collect Docker logs on failure | |
| if: failure() | |
| run: | | |
| docker compose -f compose.yml logs --tail=100 || true | |
| docker ps -a || true | |
| lint-go: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.8.0 | |
| lint-proto: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup buf | |
| uses: bufbuild/buf-setup-action@v1.48.0 | |
| - name: Lint proto | |
| run: make lint-proto | |
| lint-front: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| package_json_file: 'front/package.json' | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: 'front/.node-version' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'front/pnpm-lock.yaml' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| working-directory: front | |
| - name: Lint front | |
| run: make lint-front |