Skip to content

Commit

Permalink
Instructs for github actions (#31)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Change go get to go install

Co-authored-by: Agniva De Sarker <[email protected]>
  • Loading branch information
realPy and agnivade authored Oct 31, 2021
1 parent ecbb5a3 commit a37e7ec
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,46 @@ addons:
chrome: stable
install:
- go get github.com/agnivade/wasmbrowsertest
- go install github.com/agnivade/wasmbrowsertest@latest
- mv $GOPATH/bin/wasmbrowsertest $GOPATH/bin/go_js_wasm_exec
- export PATH=$GOPATH/bin:$PATH
```

Now, just setting `GOOS=js GOARCH=wasm` will run your tests using `wasmbrowsertest`. For other CI environments, you have to do something similar.

### Can I use this inside Github Action?

Sure.

Add these lines to your `.github/workflows/ci.yml`

PS: adjust the go version you need in go-version section

```
on: [push, pull_request]
name: Unit Test
jobs:
test:
strategy:
matrix:
go-version: [1.xx.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install chrome
uses: browser-actions/setup-chrome@latest
- name: Install dep
run: go install github.com/agnivade/wasmbrowsertest@latest
- name: Setup wasmexec
run: mv $(go env GOPATH)/bin/wasmbrowsertest $(go env GOPATH)/bin/go_js_wasm_exec
- name: Checkout code
uses: actions/checkout@v2
```

### What sorts of browsers are supported ?

This tool uses the [ChromeDP](https://chromedevtools.github.io/devtools-protocol/) protocol to run the tests inside a Chrome browser. So Chrome or any blink-based browser will work.
Expand Down

0 comments on commit a37e7ec

Please sign in to comment.