Skip to content

Add e2e testing

Add e2e testing #94

# 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:
matrix:
os: [ ubuntu-latest, macos-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
run: ./build_wasm
- name: Prepare Tests (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install --cask [email protected]
brew install --cask [email protected]
- 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