Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-9251: Run browser tests on different Ubuntu versions #54

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ on:
description: "Job maximum timeout in minutes"
required: false
type: number
selected-os:
default: "ubuntu-latest"
description: "Ubuntu OS version"
required: false
type: string
secrets:
SLACK_WEBHOOK_URL:
required: true
Expand Down Expand Up @@ -102,6 +107,7 @@ jobs:
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
job-count: ${{ steps.generate-matrix.outputs.job-count }}
selected-os: ${{ steps.select-os.outputs.selected-os }}
steps:
- name: Set job count for builds
run: echo "job_count=${{ inputs.job-count }}" >> $GITHUB_ENV
Expand All @@ -117,6 +123,14 @@ jobs:
- name: (v3) Limit job-count to 1 for PRs
if: github.event_name == 'pull_request' && inputs.project-version == '^3.3.x-dev'
run: echo "job_count=1" >> $GITHUB_ENV
- name: Select Random OS
id: select-os
run: |
OS_ARRAY=("ubuntu-20.04" "ubuntu-22.04" "ubuntu-24.04")
RANDOM_INDEX=$(( RANDOM % ${#OS_ARRAY[@]} ))
SELECTED_OS=${OS_ARRAY[$RANDOM_INDEX]}
echo "selected-os=$SELECTED_OS" >> $GITHUB_ENV
echo "selected-os=$SELECTED_OS" >> $GITHUB_OUTPUT
- name: Generate matrix
id: generate-matrix
run: |
Expand All @@ -126,12 +140,16 @@ jobs:

browser-tests:
needs: setup-jobs
runs-on: ubuntu-latest
runs-on: ${{ needs.setup-jobs.outputs.selected-os }}
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup-jobs.outputs.matrix) }}
steps:
- name: Check Ubuntu Version
run: |
source /etc/os-release
echo "Running on Ubuntu version $VERSION_ID"
- if: contains(inputs.setup, 'varnish')
name: "[Varnish] Set the URL the tests should access"
run: echo "WEB_HOST=http://varnish" >> $GITHUB_ENV
Expand Down