-
Notifications
You must be signed in to change notification settings - Fork 3.9k
119 lines (108 loc) · 3.32 KB
/
test-authnz.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Test Authentication/Authorization backends
on:
push:
branches:
- main
- v3.12.x
- v3.11.x
paths:
- 'deps/rabbit/**'
- 'deps/rabbitmq_auth_**'
- 'deps/rabbitmq_management/selenium/**'
- 'scripts/**'
- .bazelrc
- .bazelversion
- BUILD.*
- '*.bzl'
- '*.bazel'
- .github/workflows/test-authnz.yaml
pull_request:
paths:
- 'deps/rabbit/**'
- 'deps/rabbitmq_auth_/**'
- .github/workflows/test-authnz.yaml
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.1"
browser:
- chrome
include:
- erlang_version: "26.1"
elixir_version: 1.15.2
env:
SELENIUM_DIR: deps/rabbitmq_management/selenium
DOCKER_NETWORK: rabbitmq_net
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure OTP & Elixir
uses: erlef/[email protected]
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
- name: Mount Bazel Cache
uses: actions/[email protected]
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 full-suite-authnz
- name: Upload Test Artifacts
if: always()
uses: actions/[email protected]
with:
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
path: |
logs/*
screens/*
/tmp/selenium/*
summary-selenium:
needs:
- selenium
runs-on: ubuntu-latest
steps:
- name: SUMMARY
run: |
echo "SUCCESS"