|
| 1 | +name: Test target (make) |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + erlang_version: |
| 6 | + required: true |
| 7 | + type: string |
| 8 | + elixir_version: |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + metadata_store: |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + make_target: |
| 15 | + required: true |
| 16 | + type: string |
| 17 | + plugin: |
| 18 | + required: true |
| 19 | + type: string |
| 20 | +jobs: |
| 21 | + test: |
| 22 | + name: ${{ inputs.plugin }} (${{ inputs.make_target }}) |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 30 |
| 25 | + steps: |
| 26 | + - name: CHECKOUT REPOSITORY |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: FETCH TAGS |
| 30 | + run: git fetch --tags |
| 31 | + |
| 32 | + - name: SETUP OTP & ELIXIR |
| 33 | + |
| 34 | + with: |
| 35 | + otp-version: ${{ inputs.erlang_version }} |
| 36 | + elixir-version: ${{ inputs.elixir_version }} |
| 37 | + hexpm-mirrors: | |
| 38 | + https://builds.hex.pm |
| 39 | + https://cdn.jsdelivr.net/hex |
| 40 | + # This currently only applies to Elixir; and can be safely |
| 41 | + # restricted to the build jobs to avoid duplication in output. |
| 42 | + disable_problem_matchers: true |
| 43 | + |
| 44 | + - name: SETUP DOTNET (rabbit) |
| 45 | + uses: actions/setup-dotnet@v4 |
| 46 | + if: inputs.plugin == 'rabbit' |
| 47 | + with: |
| 48 | + dotnet-version: '3.1.x' |
| 49 | + |
| 50 | + - name: SETUP SLAPD (rabbitmq_auth_backend_ldap) |
| 51 | + if: inputs.plugin == 'rabbitmq_auth_backend_ldap' |
| 52 | + run: | |
| 53 | + sudo apt-get update && \ |
| 54 | + sudo apt-get install -y \ |
| 55 | + ldap-utils \ |
| 56 | + slapd |
| 57 | +
|
| 58 | + sudo service apparmor stop |
| 59 | +
|
| 60 | + - name: RUN TESTS |
| 61 | + if: inputs.plugin != 'rabbitmq_cli' |
| 62 | + run: | |
| 63 | + make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }} |
| 64 | +
|
| 65 | + # rabbitmq_cli needs a correct broker version for two of its tests. |
| 66 | + # But setting PROJECT_VERSION makes other plugins fail. |
| 67 | + - name: RUN TESTS (rabbitmq_cli) |
| 68 | + if: inputs.plugin == 'rabbitmq_cli' |
| 69 | + run: | |
| 70 | + make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }} PROJECT_VERSION="4.1.0" |
| 71 | +
|
| 72 | + - name: UPLOAD TEST LOGS |
| 73 | + if: always() |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: CT logs (${{ inputs.plugin }} ${{ inputs.make_target }} OTP-${{ inputs.erlang_version }} ${{ inputs.metadata_store }}) |
| 77 | + path: | |
| 78 | + logs/ |
| 79 | + !logs/**/log_private |
| 80 | + if-no-files-found: ignore |
0 commit comments