name: HTMLUI
on:
  pull_request:
    branches: [ master ]
  push:
    # ci-sandbox is a branch dedicated to testing post-submit code.
    branches: [ master, artifacts-pr ]
    tags:
      - v*
env:
  # environment variables shared between build steps
  # do not include sensitive credentials and tokens here, instead pass them
  # directly to tools that need them to limit the blast radius in case one of them
  # becomes compromised and leaks credentials to external sites.
  # required by Makefile
  UNIX_SHELL_ON_WINDOWS: true
  # set (to any value other than false) to trigger random unicode filenames testing (logs may be difficult to read)
  ENABLE_UNICODE_FILENAMES: ${{ secrets.ENABLE_UNICODE_FILENAMES }}
  # disable long filenames since they sometimes get messed up when simulating input keystrokes
  ENABLE_LONG_FILENAMES: false
concurrency: 
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  end-to-end-test:
    name: E2E Test
    runs-on: macos-latest
    steps:
    - name: Check out repository
      uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
      with:
        fetch-depth: 0
    - name: Set up Go
      uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
      with:
        go-version-file: 'go.mod'
        check-latest: true
      id: go
    - name: Run Tests
      run: make htmlui-e2e-test
    - name: Upload Screenshots
      uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
      with:
        path: .screenshots/**/*.png
        if-no-files-found: ignore
      if: ${{ always() }}
