From 53d5b6a4994f9685f3daa489585ec17aa951f85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Tue, 26 Nov 2024 12:23:23 +0100 Subject: [PATCH 1/7] IBX-9251: Run on Ubuntu 24.04 --- .github/workflows/browser-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index b1cd16f..d827b72 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -97,7 +97,7 @@ env: jobs: setup-jobs: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 # Current latest (stable) is 22.04 timeout-minutes: 1 outputs: matrix: ${{ steps.generate-matrix.outputs.matrix }} @@ -126,7 +126,7 @@ jobs: browser-tests: needs: setup-jobs - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: ${{ inputs.timeout }} strategy: fail-fast: false From 058c5df6767873e27edffcd5bdf6d0e7d45cd343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Tue, 17 Dec 2024 14:37:08 +0100 Subject: [PATCH 2/7] run on ubuntu-runners group --- .github/workflows/browser-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index d827b72..981bc3d 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -97,7 +97,8 @@ env: jobs: setup-jobs: - runs-on: ubuntu-24.04 # Current latest (stable) is 22.04 + runs-on: + group: ubuntu-runners timeout-minutes: 1 outputs: matrix: ${{ steps.generate-matrix.outputs.matrix }} @@ -126,7 +127,8 @@ jobs: browser-tests: needs: setup-jobs - runs-on: ubuntu-24.04 + runs-on: + group: ubuntu-runners timeout-minutes: ${{ inputs.timeout }} strategy: fail-fast: false From 7d11ab11e9ee9ad24538ae6522db98600845bf8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Wed, 18 Dec 2024 10:56:57 +0100 Subject: [PATCH 3/7] randomly select between ubuntu versions --- .github/workflows/browser-tests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index 981bc3d..08ab117 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -97,8 +97,7 @@ env: jobs: setup-jobs: - runs-on: - group: ubuntu-runners + runs-on: ubuntu-latest timeout-minutes: 1 outputs: matrix: ${{ steps.generate-matrix.outputs.matrix }} @@ -118,6 +117,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: | @@ -127,13 +134,14 @@ jobs: browser-tests: needs: setup-jobs - runs-on: - group: ubuntu-runners + 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 OS + run: echo "Running on ${{ runner.os }}" - if: contains(inputs.setup, 'varnish') name: "[Varnish] Set the URL the tests should access" run: echo "WEB_HOST=http://varnish" >> $GITHUB_ENV From 5ed07e749c6856f35aea99b3fc20743f91edec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Wed, 18 Dec 2024 11:34:02 +0100 Subject: [PATCH 4/7] explicitly add new output --- .github/workflows/browser-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index 08ab117..6266c9b 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -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 From ee44b3da255a05118dd46046b0e1271dd6b01c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Wed, 18 Dec 2024 11:58:51 +0100 Subject: [PATCH 5/7] add new value to job outputs --- .github/workflows/browser-tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index 6266c9b..ae95446 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -63,7 +63,7 @@ on: description: "Job maximum timeout in minutes" required: false type: number - selected_os: + selected-os: default: "ubuntu-latest" description: "Ubuntu OS version" required: false @@ -107,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 @@ -128,8 +129,8 @@ jobs: 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 + echo "selected-os=$SELECTED_OS" >> $GITHUB_ENV + echo "selected-os=$SELECTED_OS" >> $GITHUB_OUTPUT - name: Generate matrix id: generate-matrix run: | @@ -139,7 +140,7 @@ jobs: browser-tests: needs: setup-jobs - runs-on: ${{ needs.setup-jobs.outputs.selected_os }} + runs-on: ${{ needs.setup-jobs.outputs.selected-os }} timeout-minutes: ${{ inputs.timeout }} strategy: fail-fast: false From af714a52a90b1190ff71966b2fd5fd635724db8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Wed, 18 Dec 2024 12:08:52 +0100 Subject: [PATCH 6/7] check precise os version --- .github/workflows/browser-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index ae95446..cdd1bbc 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -146,8 +146,10 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.setup-jobs.outputs.matrix) }} steps: - - name: Check OS - run: echo "Running on ${{ runner.os }}" + - 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 From dff4a68a23bf7b13f34e83b79f44a539056a2321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szo=C5=82tysek?= Date: Mon, 20 Jan 2025 12:34:02 +0100 Subject: [PATCH 7/7] persist random selection --- .github/workflows/browser-tests.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index cdd1bbc..0cd5445 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -64,7 +64,7 @@ on: required: false type: number selected-os: - default: "ubuntu-latest" + default: "" description: "Ubuntu OS version" required: false type: string @@ -126,9 +126,13 @@ jobs: - 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]} + if [ -z "${{ github.event.inputs.selected-os }}" ]; then + OS_ARRAY=("ubuntu-20.04" "ubuntu-22.04" "ubuntu-24.04") + RANDOM_INDEX=$(( RANDOM % ${#OS_ARRAY[@]} )) + SELECTED_OS=${OS_ARRAY[$RANDOM_INDEX]} + else + SELECTED_OS=${{ github.event.inputs.selected-os }} + fi echo "selected-os=$SELECTED_OS" >> $GITHUB_ENV echo "selected-os=$SELECTED_OS" >> $GITHUB_OUTPUT - name: Generate matrix