-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
311 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
name: Test Plugin | ||
on: | ||
workflow_call: | ||
inputs: | ||
repo_cache_key: | ||
required: true | ||
type: string | ||
plugin: | ||
required: true | ||
type: string | ||
secrets: | ||
REMOTE_CACHE_BUCKET_NAME: | ||
required: true | ||
REMOTE_CACHE_CREDENTIALS_JSON: | ||
required: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
erlang_version: | ||
- 26 | ||
metadata_store: | ||
- mnesia | ||
- khepri | ||
include: | ||
- erlang_version: 26 | ||
elixir_version: 1.15 | ||
timeout-minutes: 120 | ||
steps: | ||
- name: LOAD REPO CACHE | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: ${{ inputs.repo_cache_key }} | ||
path: /home/runner/repo-cache/ | ||
- name: CHECKOUT REPOSITORY | ||
uses: actions/checkout@v4 | ||
- name: CONFIGURE OTP & ELIXIR | ||
uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{ matrix.erlang_version }} | ||
elixir-version: ${{ matrix.elixir_version }} | ||
hexpm-mirrors: | | ||
https://builds.hex.pm | ||
https://cdn.jsdelivr.net/hex | ||
# - name: AUTHENTICATE TO GOOGLE CLOUD | ||
# uses: google-github-actions/[email protected] | ||
# with: | ||
# credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }} | ||
# - name: CONFIGURE BAZEL | ||
# run: | | ||
# if [ -n "${{ secrets.REMOTE_CACHE_BUCKET_NAME }}" ]; then | ||
# cat << EOF >> user.bazelrc | ||
# build --remote_cache=https://storage.googleapis.com/${{ secrets.REMOTE_CACHE_BUCKET_NAME }} | ||
# build --google_default_credentials | ||
# | ||
# build --experimental_guard_against_concurrent_changes | ||
# EOF | ||
# fi | ||
# cat << EOF >> user.bazelrc | ||
# build --repository_cache=/home/runner/repo-cache/ | ||
# build --color=yes | ||
# EOF | ||
# | ||
# bazelisk info release | ||
# #! - name: Setup tmate session | ||
# #! uses: mxschmitt/action-tmate@v3 | ||
- uses: actions/setup-dotnet@v4 | ||
if: inputs.plugin == 'rabbit' | ||
with: | ||
dotnet-version: '3.1.x' | ||
# - name: deps/amqp10_client SETUP | ||
# if: inputs.plugin == 'amqp10_client' | ||
# run: | | ||
# # reduce sandboxing so that activemq works | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbit SETUP | ||
# if: inputs.plugin == 'rabbit' | ||
# run: | | ||
# # reduce sandboxing so that maven works | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
- name: deps/rabbitmq_auth_backend_ldap SETUP | ||
if: inputs.plugin == 'rabbitmq_auth_backend_ldap' | ||
run: | | ||
sudo apt-get update && \ | ||
sudo apt-get install -y \ | ||
apparmor-utils \ | ||
ldap-utils \ | ||
slapd | ||
sudo aa-complain `which slapd` | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbitmq_mqtt SETUP | ||
# if: inputs.plugin == 'rabbitmq_mqtt' | ||
# run: | | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbitmq_peer_discovery_consul SETUP | ||
# if: inputs.plugin == 'rabbitmq_peer_discovery_consul' | ||
# run: | | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbitmq_stream SETUP | ||
# if: inputs.plugin == 'rabbitmq_stream' | ||
# run: | | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbitmq_stream_management SETUP | ||
# if: inputs.plugin == 'rabbitmq_stream_management' | ||
# run: | | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: deps/rabbitmq_tracing SETUP | ||
# if: inputs.plugin == 'rabbitmq_tracing' | ||
# run: | | ||
# cat << EOF >> user.bazelrc | ||
# build --strategy=TestRunner=local | ||
# EOF | ||
# - name: CLI COMPILE WARNINGS AS ERRORS | ||
# if: inputs.plugin == 'rabbitmq_cli' | ||
# run: | | ||
# bazel build //deps/rabbitmq_cli:compile_warnings_as_errors \ | ||
# --verbose_failures | ||
# - name: COMPUTE TESTS IN SHARD | ||
# id: shard | ||
# run: | | ||
# bazelisk cquery \ | ||
# 'tests(//deps/${{ inputs.plugin }}/...) except attr("tags", "manual|mixed-version-cluster", //deps/...)' \ | ||
# --output=label \ | ||
# | awk '{print $1;}' > tests.log | ||
# split -da 3 -l $((`wc -l < tests.log`/${{ inputs.shard_count }})) tests.log shard | ||
# printf -v padded_index "%03d" ${{ inputs.shard_index }} | ||
# echo "file=shard$padded_index" | tee -a $GITHUB_OUTPUT | ||
- name: RUN TESTS | ||
if: inputs.plugin != 'rabbitmq_peer_discovery_aws' | ||
run: | | ||
make -C deps/${{ inputs.plugin }} parallel-ct RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | ||
# echo "Tests in shard:" | ||
# cat ${{ steps.shard.outputs.file }} | ||
# echo "" | ||
|
||
## WARNING: | ||
## secrets must not be set in --test_env or --action_env, | ||
## or otherwise logs must not be saved as artifacts. | ||
## rabbit_ct_helpers or other code may log portions of the | ||
## env vars and leak them | ||
|
||
# bazelisk test $(< ${{ steps.shard.outputs.file }}) \ | ||
# --test_env RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} \ | ||
# --build_tests_only \ | ||
# --verbose_failures | ||
# - name: UPLOAD TEST LOGS | ||
# if: always() | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: bazel-testlogs-${{ inputs.plugin }}-${{ inputs.shard_index }}-${{ matrix.erlang_version }}-${{ matrix.metadata_store }} | ||
# path: | | ||
# bazel-testlogs/deps/${{ inputs.plugin }}/* |
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
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