|
| 1 | +name: Deploy specific Chrome for Testing version |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + stable: |
| 7 | + description: 'Use upstream stable build' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + default: 'true' |
| 11 | + reuse-base: |
| 12 | + description: 'Reuse base image to build' |
| 13 | + required: false |
| 14 | + type: boolean |
| 15 | + default: true |
| 16 | + grid-version: |
| 17 | + description: 'Grid version to build. E.g: 4.28.1. Must provide if reusing base image' |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + default: '' |
| 21 | + build-date: |
| 22 | + description: 'Build date in format YYYYMMDD. Must provide if reusing base image' |
| 23 | + required: false |
| 24 | + type: string |
| 25 | + default: '20251025' |
| 26 | + browser-name: |
| 27 | + description: 'Browser name to build. E.g: chrome-for-testing' |
| 28 | + required: true |
| 29 | + type: string |
| 30 | + default: 'chrome-for-testing' |
| 31 | + browser-versions: |
| 32 | + description: 'List browser version to build. E.g: [130, 131]' |
| 33 | + required: true |
| 34 | + default: '[113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142]' |
| 35 | + push-image: |
| 36 | + description: 'Push image after testing successfully' |
| 37 | + required: true |
| 38 | + type: boolean |
| 39 | + default: false |
| 40 | + pr-changelog: |
| 41 | + description: 'Create a PR for CHANGELOG' |
| 42 | + required: true |
| 43 | + type: boolean |
| 44 | + default: true |
| 45 | + |
| 46 | +env: |
| 47 | + GRID_VERSION: ${{ github.event.inputs.grid-version }} |
| 48 | + BROWSER_NAME: ${{ github.event.inputs.browser-name }} |
| 49 | + REUSE_BASE: ${{ github.event.inputs.reuse-base || true }} |
| 50 | + BUILD_DATE: ${{ github.event.inputs.build-date || '' }} |
| 51 | + NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} |
| 52 | + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} |
| 53 | + PUSH_IMAGE: ${{ github.event.inputs.push-image || false }} |
| 54 | + PR_CHANGELOG: ${{ github.event.inputs.pr-changelog || true }} |
| 55 | + RUN_ID: ${{ github.run_id }} |
| 56 | + |
| 57 | +jobs: |
| 58 | + deploy: |
| 59 | + name: Node/Standalone Chrome for Testing |
| 60 | + runs-on: ubuntu-24.04 |
| 61 | + permissions: write-all |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + max-parallel: 10 |
| 65 | + matrix: |
| 66 | + browser-version: ${{ fromJSON(github.event.inputs.browser-versions)}} |
| 67 | + outputs: |
| 68 | + GRID_VERSION: ${{ steps.display_grid_version.outputs.GRID_VERSION }} |
| 69 | + steps: |
| 70 | + - name: Checkout code |
| 71 | + uses: actions/checkout@main |
| 72 | + with: |
| 73 | + persist-credentials: false |
| 74 | + fetch-depth: 0 |
| 75 | + - name: Set up containerd image store feature |
| 76 | + uses: nick-invision/retry@master |
| 77 | + with: |
| 78 | + timeout_minutes: 10 |
| 79 | + max_attempts: 3 |
| 80 | + command: | |
| 81 | + INSTALL_DOCKER=false make setup_dev_env |
| 82 | + - name: Output Docker info |
| 83 | + run: docker info |
| 84 | + - name: Set Selenium base version |
| 85 | + uses: ./.github/actions/get-latest-upstream |
| 86 | + with: |
| 87 | + release: ${{ github.event.inputs.stable || true }} |
| 88 | + gh_cli_token: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + - name: Sets build date |
| 90 | + run: | |
| 91 | + if [ -z "${BUILD_DATE}" ]; then |
| 92 | + echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV |
| 93 | + else |
| 94 | + echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV |
| 95 | + fi |
| 96 | + echo "NAME=${NAMESPACE}" >> $GITHUB_ENV |
| 97 | + echo "BROWSER_VERSION=${BROWSER_VERSION}" >> $GITHUB_ENV |
| 98 | + env: |
| 99 | + BROWSER_VERSION: ${{ matrix.browser-version }} |
| 100 | + - name: Get Grid version |
| 101 | + if: env.GRID_VERSION == '' |
| 102 | + run: | |
| 103 | + echo ${BASE_VERSION} |
| 104 | + echo "GRID_VERSION=${BASE_VERSION}" >> $GITHUB_ENV |
| 105 | + - name: Display Grid version |
| 106 | + id: display_grid_version |
| 107 | + run: | |
| 108 | + echo ${GRID_VERSION} |
| 109 | + echo "GRID_VERSION=${GRID_VERSION}" >> "$GITHUB_OUTPUT" |
| 110 | + - name: Login Docker Hub |
| 111 | + run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" |
| 112 | + env: |
| 113 | + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} |
| 114 | + DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} |
| 115 | + - name: Build images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 116 | + uses: nick-invision/retry@master |
| 117 | + with: |
| 118 | + timeout_minutes: 20 |
| 119 | + max_attempts: 3 |
| 120 | + retry_wait_seconds: 60 |
| 121 | + command: | |
| 122 | + make update_browser_versions_matrix |
| 123 | + ./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE} |
| 124 | + EXIT_CODE=$? |
| 125 | + cat .env | xargs -I {} echo {} >> $GITHUB_ENV |
| 126 | + exit $EXIT_CODE |
| 127 | + - name: Build Hub image for testing |
| 128 | + if: env.REUSE_BASE == 'false' |
| 129 | + run: make hub |
| 130 | + - name: Test images Node with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 131 | + uses: nick-invision/retry@master |
| 132 | + with: |
| 133 | + timeout_minutes: 20 |
| 134 | + max_attempts: 3 |
| 135 | + retry_wait_seconds: 60 |
| 136 | + command: | |
| 137 | + make test_chrome |
| 138 | + - name: Test images Standalone with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 139 | + uses: nick-invision/retry@master |
| 140 | + with: |
| 141 | + timeout_minutes: 20 |
| 142 | + max_attempts: 3 |
| 143 | + retry_wait_seconds: 60 |
| 144 | + command: | |
| 145 | + make test_chrome_standalone \ |
| 146 | + && make test_chrome_standalone_java |
| 147 | + - name: Push images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }} |
| 148 | + if: env.PUSH_IMAGE == 'true' |
| 149 | + run: | |
| 150 | + ./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE} true true |
| 151 | + - name: Upload changelog |
| 152 | + if: always() |
| 153 | + uses: actions/upload-artifact@main |
| 154 | + with: |
| 155 | + name: image_tags_${{ env.GRID_VERSION }}_${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }} |
| 156 | + path: ./CHANGELOG/${{ env.GRID_VERSION }}/${{ env.BROWSER_NAME }}_${{ env.BROWSER_VERSION }}.md |
| 157 | + if-no-files-found: ignore |
| 158 | + |
| 159 | + pr-results: |
| 160 | + if: (!failure() && !cancelled() && (github.event.inputs.pr-changelog == 'true')) |
| 161 | + uses: ./.github/workflows/create-changelog-pr.yml |
| 162 | + needs: deploy |
| 163 | + with: |
| 164 | + grid-version: ${{ needs.deploy.outputs.GRID_VERSION }} |
| 165 | + browser-name: ${{ github.event.inputs.browser-name }} |
| 166 | + browser-versions: ${{ github.event.inputs.browser-versions }} |
| 167 | + run-id: ${{ github.run_id }} |
| 168 | + secrets: inherit |
0 commit comments