Repository navigation
docs: a Symfony and API Platform page for 1.0 #2141
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 and Test Hub | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| GOTOOLCHAIN: local | |
| GOFLAGS: "-tags=deprecated_transport,deprecated_topic,deprecated_claim,nobadger,nomysql,nopgx" | |
| jobs: | |
| golangci: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: "1.26" | |
| cache-dependency-path: | | |
| go.sum | |
| caddy/go.sum | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: latest | |
| args: --timeout=30m | |
| - name: golangci-lint (caddy module) | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: latest | |
| args: --timeout=30m --config ../.golangci.yml | |
| working-directory: caddy | |
| # The config pins the tags the release is built with, so the build-tag | |
| # variants selected by !deprecated_topic / !deprecated_claim would never | |
| # be linted. Mirror the reduced-tag test run below. | |
| - name: golangci-lint (without the deprecated_topic and deprecated_claim tags) | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: latest | |
| args: --timeout=30m --build-tags deprecated_transport,nobadger,nomysql,nopgx | |
| # infertypeargs is a gopls-only analyzer, unavailable in golangci-lint. | |
| - name: gopls infertypeargs | |
| run: | | |
| go install golang.org/x/tools/gopls@latest | |
| mapfile -t files < <(git ls-files ':!:caddy/**' '*.go') | |
| out=$(gopls check -severity=hint "${files[@]}" || true) | |
| echo "$out" | |
| ! echo "$out" | grep -q "unnecessary type arguments" | |
| test: | |
| strategy: | |
| matrix: | |
| go: ["1.26"] | |
| fail-fast: false | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| cache-dependency-path: | | |
| go.sum | |
| caddy/go.sum | |
| - name: Use go-deadlock | |
| run: ./tests/use-go-deadlock.sh | |
| - name: Test | |
| run: go test -race -covermode atomic -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./... | |
| - name: Test (without the deprecated_topic and deprecated_claim tags) | |
| run: go test -tags=deprecated_transport,nobadger,nomysql,nopgx ./... | |
| env: | |
| GOFLAGS: "" | |
| - name: Test Caddy module | |
| working-directory: caddy/ | |
| run: | | |
| go test -timeout 1m -race -covermode atomic -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./... | |
| sed '1d' profile.cov >> ../profile.cov | |
| - name: Upload coverage results | |
| uses: shogo82148/actions-goveralls@8781f5dd05b691c4dd042d5e859c11c73e0104fa # v1.11.1 | |
| with: | |
| path-to-profile: profile.cov | |
| parallel: true | |
| - name: Start Mercure | |
| working-directory: caddy/mercure/ | |
| run: sudo MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_EXTRA_DIRECTIVES='playground' go run main.go start --config ../../Caddyfile | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: "lts/*" | |
| cache: "npm" | |
| cache-dependency-path: conformance-tests/package-lock.json | |
| - name: Install Playwrigth dependencies | |
| working-directory: conformance-tests/ | |
| run: npm ci | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('conformance-tests/package-lock.json') }} | |
| - name: Install Playwright system dependencies | |
| working-directory: conformance-tests/ | |
| timeout-minutes: 10 | |
| run: npx playwright install-deps | |
| - name: Install playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: conformance-tests/ | |
| timeout-minutes: 15 | |
| env: | |
| DEBUG: pw:install | |
| # The CDN download can hang mid-install; bound each attempt and retry | |
| # instead of letting the step-level timeout kill the whole job. | |
| run: | | |
| for i in 1 2 3; do | |
| timeout 240 npx playwright install && exit 0 | |
| echo "::warning::playwright install attempt $i failed or hung, retrying" | |
| done | |
| exit 1 | |
| - name: Run Playwright tests | |
| working-directory: conformance-tests/ | |
| run: npx playwright test | |
| finish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: shogo82148/actions-goveralls@8781f5dd05b691c4dd042d5e859c11c73e0104fa # v1.11.1 | |
| with: | |
| parallel-finished: true |