Windows Klaatu Tests #8
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 is a basic workflow that is manually triggered | |
name: Windows Klaatu Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Experiment Branch' | |
default: 'control' | |
required: true | |
type: string | |
slug: | |
description: 'Experiment Slug' | |
default: 'an-awesome-experiment' | |
required: true | |
type: string | |
firefox-version: | |
description: 'The Firefox Version(s) you want to test' | |
default: "['latest-beta', 'latest', '123.0']" | |
required: false | |
type: string | |
extra-arguments: | |
description: 'Additional testing arguments' | |
default: '' | |
required: false | |
type: string | |
env: | |
MOZ_HEADLESS: 1 | |
jobs: | |
klaatu-tests: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
firefox: ${{ fromJSON(inputs.firefox-version) }} | |
name: windows-klaatu-firefox-${{ matrix.firefox }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup firefox | |
id: setup-firefox | |
uses: ./.github/actions/setup_firefox/ | |
with: | |
firefox-version: ${{ matrix.firefox }} | |
- run: | | |
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Chocolatey | |
shell: pwsh | |
run: Set-ExecutionPolicy Bypass -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
- name: Install Dependencies | |
shell: pwsh | |
run: choco install jdk8 selenium | |
- name: Add Firefox to Path | |
shell: powershell | |
run: | | |
$newPath = "C:\Program Files\Firefox_${{ matrix.firefox }}\firefox.exe" | |
$currentPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") | |
$newPath += ";$currentPath" | |
[System.Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine") | |
Write-Host "Path added to Windows PATH environment variable." | |
- name: Verify Path | |
shell: powershell | |
run: | | |
Write-Host "Current PATH environment variable:" | |
[System.Environment]::GetEnvironmentVariable("PATH", "Machine") | |
- name: Setup tests | |
shell: bash | |
run: ./setup_script.sh | |
- name: Run Tests | |
run: tox -e bdd-tests -- --experiment-branch ${{ inputs.branch }} --experiment-slug ${{ inputs.slug }} --private-browsing-enabled --firefox-path="C:\Program Files\Firefox_${{ matrix.firefox }}\firefox.exe" ${{ inputs.extra-arguments }} |