|
| 1 | +name: Test Management UI with Selenium for PRs |
| 2 | +on: |
| 3 | + paths: |
| 4 | + - 'deps/**' |
| 5 | + - 'selenium/**' |
| 6 | + - .github/workflows/test-management-ui-for-pr.yaml |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | +jobs: |
| 11 | + selenium: |
| 12 | + runs-on: ubuntu-22.04 |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + erlang_version: |
| 17 | + - "26.2" |
| 18 | + browser: |
| 19 | + - chrome |
| 20 | + include: |
| 21 | + - erlang_version: "26.2" |
| 22 | + elixir_version: 1.15.7 |
| 23 | + env: |
| 24 | + SELENIUM_DIR: selenium |
| 25 | + DOCKER_NETWORK: rabbitmq_net |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Configure OTP & Elixir |
| 31 | + uses: erlef/setup-beam@v1.17 |
| 32 | + with: |
| 33 | + otp-version: ${{ matrix.erlang_version }} |
| 34 | + elixir-version: ${{ matrix.elixir_version }} |
| 35 | + hexpm-mirrors: | |
| 36 | + https://builds.hex.pm |
| 37 | + https://cdn.jsdelivr.net/hex |
| 38 | +
|
| 39 | + - name: Authenticate To Google Cloud |
| 40 | + uses: google-github-actions/auth@v2.1.5 |
| 41 | + with: |
| 42 | + credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }} |
| 43 | + |
| 44 | + - name: Configure Bazel |
| 45 | + run: | |
| 46 | + if [ -n "${{ secrets.REMOTE_CACHE_BUCKET_NAME }}" ]; then |
| 47 | + cat << EOF >> user.bazelrc |
| 48 | + build --remote_cache=https://storage.googleapis.com/${{ secrets.REMOTE_CACHE_BUCKET_NAME }} |
| 49 | + build --google_default_credentials |
| 50 | +
|
| 51 | + build --remote_download_toplevel |
| 52 | + EOF |
| 53 | + fi |
| 54 | + cat << EOF >> user.bazelrc |
| 55 | + build --color=yes |
| 56 | + EOF |
| 57 | +
|
| 58 | + - name: Build & Load RabbitMQ OCI |
| 59 | + run: | |
| 60 | + bazelisk run packaging/docker-image:rabbitmq-amd64 |
| 61 | +
|
| 62 | + - name: Configure Docker Network |
| 63 | + run: | |
| 64 | + docker network create ${DOCKER_NETWORK} |
| 65 | +
|
| 66 | + - name: Build Test Runner Image |
| 67 | + run: | |
| 68 | + cd ${SELENIUM_DIR} |
| 69 | + docker build -t mocha-test --target test . |
| 70 | +
|
| 71 | + - name: Run full ui suites on a standalone rabbitmq server |
| 72 | + run: | |
| 73 | + RABBITMQ_DOCKER_IMAGE=bazel/packaging/docker-image:rabbitmq-amd64 \ |
| 74 | + ${SELENIUM_DIR}/run-suites.sh |
| 75 | + mkdir -p /tmp/full-suite |
| 76 | + mv /tmp/selenium/* /tmp/full-suite |
| 77 | + mkdir -p /tmp/full-suite/logs |
| 78 | + mv ${SELENIUM_DIR}/logs/* /tmp/full-suite/logs |
| 79 | + mkdir -p /tmp/full-suite/screens |
| 80 | + mv ${SELENIUM_DIR}/screens/* /tmp/full-suite/screens |
| 81 | +
|
| 82 | + - name: Upload Test Artifacts |
| 83 | + if: always() |
| 84 | + uses: actions/upload-artifact@v4.3.2 |
| 85 | + with: |
| 86 | + name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }} |
| 87 | + path: | |
| 88 | + /tmp/full-suite |
| 89 | + /tmp/short-suite |
| 90 | +
|
| 91 | + summary-selenium: |
| 92 | + needs: |
| 93 | + - selenium |
| 94 | + runs-on: ubuntu-latest |
| 95 | + steps: |
| 96 | + - name: SUMMARY |
| 97 | + run: | |
| 98 | + echo "SUCCESS" |
0 commit comments