feat: Add logger override option, use slog
and capture driver as logs
#1035
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: Go | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: oldstable | |
id: go | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
browser: [chromium, firefox, webkit] | |
go: ['stable', 'oldstable'] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.browser }} on ${{ matrix.os }}, go ${{ matrix.go }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
id: go | |
- name: Cache drivers | |
uses: actions/cache@v4 | |
with: | |
# In order: | |
# * Driver for linux | |
# * Driver for macOS | |
# * Driver for windows | |
path: | | |
~/.cache/ms-playwright-go | |
~/.cache/ms-playwright | |
~/Library/Caches/ms-playwright-go | |
~/Library/Caches/ms-playwright | |
~\AppData\Local\ms-playwright-go | |
~\AppData\Local\ms-playwright | |
key: ${{ runner.os }}-go${{ matrix.go }}-${{ matrix.browser }}-${{ hashFiles('**/run.go') }} | |
- run: | | |
go install ./... | |
playwright install --with-deps ${{ matrix.browser }} | |
- name: Test | |
env: | |
BROWSER: ${{ matrix.browser }} | |
GOEXPERIMENT: nocoverageredesign | |
if: matrix.os == 'ubuntu-latest' | |
run: xvfb-run go test -timeout 15m -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./... | |
- name: Test | |
env: | |
BROWSER: ${{ matrix.browser }} | |
GOEXPERIMENT: nocoverageredesign | |
if: matrix.os != 'ubuntu-latest' | |
run: go test -timeout 15m -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./... | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Send coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
continue-on-error: true | |
run: goveralls -coverprofile=covprofile -service=github -parallel -flagname="${{ matrix.os }}-${{ matrix.browser }}" | |
finish: | |
if: ${{ always() }} | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: oldstable | |
id: go | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Finish | |
run: goveralls -service=github -parallel-finish | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: oldstable | |
id: go | |
- run: | | |
go install ./... | |
playwright install --with-deps | |
- name: Run examples | |
run: | | |
for dir in examples/*; do | |
echo "::group::go run $dir/main.go" | |
xvfb-run -a go run $dir/main.go | |
echo "::endgroup::" | |
done |