...
1name: Go
2on:
3 push:
4 branches: [ main ]
5 pull_request:
6 branches: [ main ]
7jobs:
8 lint:
9 name: Lint
10 runs-on: ubuntu-latest
11 steps:
12 - uses: actions/checkout@v2
13 - name: golangci-lint
14 uses: golangci/golangci-lint-action@v2
15 with:
16 version: latest
17 test:
18 strategy:
19 fail-fast: false
20 matrix:
21 os: [ubuntu-latest, windows-latest, macos-latest]
22 browser: [chromium, firefox, webkit]
23 runs-on: ${{ matrix.os }}
24 name: ${{ matrix.browser }} on ${{ matrix.os }}
25 steps:
26 - uses: actions/checkout@v2
27 with:
28 submodules: true
29 - name: Set up Go
30 uses: actions/setup-go@v2
31 with:
32 go-version: ^1.16.1
33 id: go
34 - run: |
35 go install ./...
36 playwright install --with-deps ${{ matrix.browser }}
37 - name: Test
38 env:
39 BROWSER: ${{ matrix.browser }}
40 if: matrix.os == 'ubuntu-latest'
41 run: xvfb-run go test -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./...
42 - name: Test
43 env:
44 BROWSER: ${{ matrix.browser }}
45 if: matrix.os != 'ubuntu-latest'
46 run: go test -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./...
47 - name: Install goveralls
48 env:
49 GO111MODULE: off
50 run: go get github.com/mattn/goveralls
51 - name: Send coverage
52 env:
53 COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 continue-on-error: true
55 run: goveralls -coverprofile=covprofile -service=github -parallel -flagname="${{ matrix.os }}-${{ matrix.browser }}"
56 finish:
57 if: ${{ always() }}
58 needs: test
59 runs-on: ubuntu-latest
60 steps:
61 - uses: actions/checkout@v2
62 - name: Set up Go
63 uses: actions/setup-go@v2
64 with:
65 go-version: ^1.16.1
66 id: go
67 - name: Install goveralls
68 env:
69 GO111MODULE: off
70 run: go get github.com/mattn/goveralls
71 - name: Finish
72 run: goveralls -service=github -parallel-finish
73 env:
74 COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75 test-examples:
76 runs-on: ubuntu-latest
77 steps:
78 - uses: actions/checkout@v2
79 - name: Set up Go 1.x
80 uses: actions/setup-go@v2
81 with:
82 go-version: ^1.16.1
83 id: go
84 - run: |
85 go install ./...
86 playwright install --with-deps
87 - name: Run examples
88 run: |
89 for dir in examples/*; do
90 echo "::group::go run $dir/main.go"
91 xvfb-run go run $dir/main.go
92 echo "::endgroup::"
93 done
View as plain text