|
| 1 | +name: Test Authentication/Authorization backends |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - v3.12.x |
| 7 | + - v3.11.x |
| 8 | + paths: |
| 9 | + - 'deps/rabbit/**' |
| 10 | + - 'deps/rabbitmq_auth_**' |
| 11 | + - 'deps/rabbitmq_management/selenium/**' |
| 12 | + - 'scripts/**' |
| 13 | + - .bazelrc |
| 14 | + - .bazelversion |
| 15 | + - BUILD.* |
| 16 | + - '*.bzl' |
| 17 | + - '*.bazel' |
| 18 | + - .github/workflows/test-authnz.yaml |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 21 | + cancel-in-progress: true |
| 22 | +jobs: |
| 23 | + selenium: |
| 24 | + runs-on: ubuntu-20.04 |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + erlang_version: |
| 29 | + - "26.0" |
| 30 | + browser: |
| 31 | + - chrome |
| 32 | + include: |
| 33 | + - erlang_version: "26.0" |
| 34 | + elixir_version: 1.14.5 |
| 35 | + env: |
| 36 | + SELENIUM_DIR: deps/rabbitmq_management/selenium |
| 37 | + DOCKER_NETWORK: rabbitmq_net |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Configure OTP & Elixir |
| 43 | + |
| 44 | + with: |
| 45 | + otp-version: ${{ matrix.erlang_version }} |
| 46 | + elixir-version: ${{ matrix.elixir_version }} |
| 47 | + |
| 48 | + - name: Mount Bazel Cache |
| 49 | + |
| 50 | + with: |
| 51 | + path: "/home/runner/repo-cache/" |
| 52 | + key: ${{ runner.os }}-repo-cache-${{ hashFiles('MODULE.bazel','WORKSPACE','bazel/bzlmod/secondary_umbrella.bzl') }} |
| 53 | + restore-keys: | |
| 54 | + ${{ runner.os }}-repo-cache- |
| 55 | +
|
| 56 | + - name: Configure Bazel |
| 57 | + run: | |
| 58 | + ERLANG_HOME="$(dirname $(dirname $(which erl)))" |
| 59 | + ELIXIR_HOME="$(dirname $(dirname $(which iex)))" |
| 60 | + if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then |
| 61 | + cat << EOF >> user.bazelrc |
| 62 | + build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} |
| 63 | + EOF |
| 64 | + fi |
| 65 | + cat << EOF >> user.bazelrc |
| 66 | + build:buildbuddy --build_metadata=ROLE=CI |
| 67 | + build:buildbuddy --build_metadata=VISIBILITY=PRIVATE |
| 68 | + build:buildbuddy --repository_cache=/home/runner/repo-cache/ |
| 69 | + build:buildbuddy --color=yes |
| 70 | + build:buildbuddy --disk_cache= |
| 71 | +
|
| 72 | + build:buildbuddy --remote_download_toplevel |
| 73 | +
|
| 74 | + build --@rules_erlang//:erlang_version=${{ matrix.erlang_version }} |
| 75 | + build --@rules_erlang//:erlang_home=${ERLANG_HOME} |
| 76 | + build --//:elixir_home=${ELIXIR_HOME} |
| 77 | + EOF |
| 78 | +
|
| 79 | + - name: Build & Load RabbitMQ OCI |
| 80 | + run: | |
| 81 | + bazelisk run packaging/docker-image:rabbitmq \ |
| 82 | + --config=buildbuddy |
| 83 | +
|
| 84 | + - name: Configure Docker Network |
| 85 | + run: | |
| 86 | + docker network create ${DOCKER_NETWORK} |
| 87 | +
|
| 88 | + - name: Build Test Runner Image |
| 89 | + run: | |
| 90 | + cd ${SELENIUM_DIR} |
| 91 | + docker build -t mocha-test --target test . |
| 92 | +
|
| 93 | + - name: Run Suites |
| 94 | + run: | |
| 95 | + RABBITMQ_DOCKER_IMAGE=bazel/packaging/docker-image:rabbitmq ${SELENIUM_DIR}/run-suites.sh full-suite-authnz |
| 96 | +
|
| 97 | + - name: Upload Test Artifacts |
| 98 | + if: always() |
| 99 | + |
| 100 | + with: |
| 101 | + name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }} |
| 102 | + path: | |
| 103 | + logs/* |
| 104 | + screens/* |
| 105 | + /tmp/selenium/* |
| 106 | +
|
| 107 | + summary-selenium: |
| 108 | + needs: |
| 109 | + - selenium |
| 110 | + runs-on: ubuntu-latest |
| 111 | + steps: |
| 112 | + - name: SUMMARY |
| 113 | + run: | |
| 114 | + echo "SUCCESS" |
0 commit comments