build(actions): checkout to the right git branch during build #157
This file contains hidden or 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
name: build | |
on: [push, pull_request] | |
env: | |
SERVER_FOLDER: rabbitmq-server | |
PLUGIN_FOLDER: rabbitmq-server/deps/rabbitmq-message-deduplication | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
PLATFORM: | |
- { RMQREF: "v3.13.x", ERLVER: "26.2", ELXVER: "1.16" } | |
- { RMQREF: "v4.0.x", ERLVER: "26.2", ELXVER: "1.16" } | |
- { RMQREF: "v4.1.x", ERLVER: "27", ELXVER: "1.18" } | |
name: "Broker: ${{ matrix.PLATFORM.RMQREF }} - Erlang: ${{ matrix.PLATFORM.ERLVER }} - Elixir: ${{ matrix.PLATFORM.ELXVER }}" | |
steps: | |
- name: Checkout RabbitMQ Server | |
uses: actions/checkout@v4 | |
with: | |
repository: rabbitmq/rabbitmq-server | |
path: ${{ env.SERVER_FOLDER }} | |
ref: ${{ matrix.PLATFORM.RMQREF }} | |
- name: Checkout Plugin | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.PLUGIN_FOLDER }} | |
ref: ${{ matrix.PLATFORM.RMQREF }} | |
- name: Install Erlang and Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.PLATFORM.ERLVER }} | |
elixir-version: ${{ matrix.PLATFORM.ELXVER }} | |
- name: Run tests | |
working-directory: ${{ env.PLUGIN_FOLDER }} | |
run: | | |
MIX_ENV=test make tests | |
- name: Store test artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests-rmq${{ matrix.PLATFORM.RMQREF }}-erl${{ matrix.PLATFORM.ERLVER }}-elx${{ matrix.PLATFORM.ELXVER }} | |
path: ${{ env.SERVER_FOLDER }}/logs/ | |
- name: Build distribution files | |
working-directory: ${{ env.PLUGIN_FOLDER }} | |
run: | | |
MIX_ENV=prod DIST_AS_EZS=yes make dist | |
- name: Store build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: plugins-rmq${{ matrix.PLATFORM.RMQREF }}-erl${{ matrix.PLATFORM.ERLVER }}-elx${{ matrix.PLATFORM.ELXVER }} | |
path: ${{ env.PLUGIN_FOLDER }}/plugins/ |