Merge pull request #9036 from rabbitmq/mergify/bp/v3.12.x/pr-9035 #5996
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
name: Test Management UI with Selenium | |
on: | |
push: | |
branches: | |
- main | |
- v3.12.x | |
- v3.11.x | |
- bump-otp-for-oci | |
- bump-rbe-* | |
- bump-rules_erlang | |
paths: | |
- 'deps/**' | |
- 'scripts/**' | |
- .bazelrc | |
- .bazelversion | |
- BUILD.* | |
- '*.bzl' | |
- '*.bazel' | |
- .github/workflows/test-selenium.yaml | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
selenium: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
erlang_version: | |
- "26.0" | |
browser: | |
- chrome | |
include: | |
- erlang_version: "26.0" | |
elixir_version: 1.14.5 | |
env: | |
SELENIUM_DIR: deps/rabbitmq_management/selenium | |
DOCKER_NETWORK: rabbitmq_net | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure OTP & Elixir | |
uses: erlef/setup-beam@v1.16 | |
with: | |
otp-version: ${{ matrix.erlang_version }} | |
elixir-version: ${{ matrix.elixir_version }} | |
- name: Mount Bazel Cache | |
uses: actions/cache@v3.2.5 | |
with: | |
path: "/home/runner/repo-cache/" | |
key: ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }} | |
restore-keys: | | |
${{ runner.os }}-repo-cache- | |
- name: Configure Bazel | |
run: | | |
ERLANG_HOME="$(dirname $(dirname $(which erl)))" | |
ELIXIR_HOME="$(dirname $(dirname $(which iex)))" | |
if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then | |
cat << EOF >> user.bazelrc | |
build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} | |
EOF | |
fi | |
cat << EOF >> user.bazelrc | |
build:buildbuddy --build_metadata=ROLE=CI | |
build:buildbuddy --build_metadata=VISIBILITY=PRIVATE | |
build:buildbuddy --repository_cache=/home/runner/repo-cache/ | |
build:buildbuddy --color=yes | |
build:buildbuddy --disk_cache= | |
build:buildbuddy --remote_download_toplevel | |
build --@rules_erlang//:erlang_version=${{ matrix.erlang_version }} | |
build --@rules_erlang//:erlang_home=${ERLANG_HOME} | |
build --//:elixir_home=${ELIXIR_HOME} | |
EOF | |
- name: Build & Load RabbitMQ OCI | |
run: | | |
bazelisk run packaging/docker-image:rabbitmq \ | |
--config=buildbuddy | |
- name: Configure Docker Network | |
run: | | |
docker network create ${DOCKER_NETWORK} | |
- name: Build Test Runner Image | |
run: | | |
cd ${SELENIUM_DIR} | |
docker build -t mocha-test --target test . | |
- name: Run Suites | |
run: | | |
RABBITMQ_DOCKER_IMAGE=bazel/packaging/docker-image:rabbitmq ${SELENIUM_DIR}/run-suites.sh | |
- name: Upload Test Artifacts | |
if: always() | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }} | |
path: | | |
logs/* | |
screens/* | |
summary-selenium: | |
needs: | |
- selenium | |
runs-on: ubuntu-latest | |
steps: | |
- name: SUMMARY | |
run: | | |
echo "SUCCESS" |