refactor: better infrastructure for transports as Caddy modules #1041
Workflow file for this run
This file contains 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 | |
tags: | |
- v*.*.* | |
env: | |
GO111MODULE: "on" | |
jobs: | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
cache-dependency-path: | | |
go.sum | |
caddy/go.sum | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
args: --timeout=30m | |
test: | |
strategy: | |
matrix: | |
go: ["1.21", "1.22", "1.23"] | |
fail-fast: false | |
name: Test | |
runs-on: ubuntu-latest | |
env: | |
# Temporary workaround for https://github.com/golang/go/issues/65653 | |
GOEXPERIMENT: nocoverageredesign | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
cache-dependency-path: | | |
go.sum | |
caddy/go.sum | |
- name: Use go-deadlock | |
# Blocked by https://github.com/sasha-s/go-deadlock/issues/34 | |
if: matrix.go != '1.23' | |
run: ./tests/use-go-deadlock.sh | |
- name: Test | |
run: go test -race -covermode atomic -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./... | |
- name: Test Caddy module | |
working-directory: caddy/ | |
run: | | |
go test -timeout 1m -race -covermode atomic -tags=nobadger,nomysql,nopgx -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./... | |
sed '1d' profile.cov >> ../profile.cov | |
- name: Upload coverage results | |
uses: shogo82148/actions-goveralls@v1 | |
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!' go run -tags=nobadger,nomysql,nopgx main.go start --config ../../dev.Caddyfile | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "16" | |
cache: "npm" | |
cache-dependency-path: conformance-tests/package-lock.json | |
- name: Install Playwrigth dependencies | |
working-directory: conformance-tests/ | |
run: npm ci | |
- name: Install playwright browsers | |
working-directory: conformance-tests/ | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
working-directory: conformance-tests/ | |
run: npx playwright test | |
finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: shogo82148/actions-goveralls@v1 | |
with: | |
parallel-finished: true |