Add e2e testing #92
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
# 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", "issue4" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-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: 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 |