Skip to content

Add e2e testing

Add e2e testing #104

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go WASM - Build, Test & Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Build
shell: bash
run: ./build_wasm
- name: Prepare Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 130
- name: Prepare Firefox
uses: browser-actions/setup-firefox@v1
with:
firefox-version: '131.0.3'
- name: Test
run: go test -v ./tests/e2e
- name: Commit and push WASM static pages
if: github.event_name == 'push' && github.ref_name == 'main' && matrix.os == 'ubuntu-latest'
env:
CI_COMMIT_MESSAGE: Add WASM static pages - $(date +'%Y-%m-%dT%H:%M:%S')
CI_COMMIT_AUTHOR: padaiyal
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git add --force script/*.wasm
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push