name: Go on: push: branches: [ main ] pull_request: branches: [ main ] jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: version: latest test: strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] browser: [chromium, firefox, webkit] runs-on: ${{ matrix.os }} name: ${{ matrix.browser }} on ${{ matrix.os }} steps: - uses: actions/checkout@v2 with: submodules: true - name: Set up Go uses: actions/setup-go@v2 with: go-version: ^1.16.1 id: go - run: | go install ./... playwright install --with-deps ${{ matrix.browser }} - name: Test env: BROWSER: ${{ matrix.browser }} if: matrix.os == 'ubuntu-latest' run: xvfb-run go test -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./... - name: Test env: BROWSER: ${{ matrix.browser }} if: matrix.os != 'ubuntu-latest' run: go test -v -covermode atomic -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./... - name: Install goveralls env: GO111MODULE: off run: go get github.com/mattn/goveralls - 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@v2 - name: Set up Go uses: actions/setup-go@v2 with: go-version: ^1.16.1 id: go - name: Install goveralls env: GO111MODULE: off run: go get github.com/mattn/goveralls - name: Finish run: goveralls -service=github -parallel-finish env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} test-examples: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Go 1.x uses: actions/setup-go@v2 with: go-version: ^1.16.1 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 go run $dir/main.go echo "::endgroup::" done