-
-
Notifications
You must be signed in to change notification settings - Fork 318
89 lines (72 loc) · 2.24 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Lint and Test Hub
on:
push:
pull_request:
env:
GO111MODULE: 'on'
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache-dependency-path: |
go.sum
caddy/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=30m
test:
strategy:
matrix:
go: [ '1.20', '1.21' ]
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
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 Caddy module
run: |
go test -timeout 1m -race -covermode atomic -coverprofile=profile.cov -coverpkg=github.com/dunglas/mercure ./...
sed '1d' profile.cov >> ../profile.cov
working-directory: ./caddy
- name: Upload coverage results
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: Start Mercure
run: |
cd caddy/mercure
sudo MERCURE_PUBLISHER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeThisMercureHubJWTSecretKey!' go run main.go start --config ../../Caddyfile.dev
cd -
- uses: actions/setup-node@v3
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