|
| 1 | +name: Check Bazel/Erlang.mk Equivalence |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: '0 2 * * *' |
| 5 | + workflow_dispatch: |
| 6 | +env: |
| 7 | + erlang_version: 25.3 |
| 8 | + elixir_version: 1.14 |
| 9 | + VERSION: 3.13.0 |
| 10 | + PLUGINS: amqp10_common amqp10_client rabbitmq_amqp1_0 rabbitmq_auth_backend_cache rabbitmq_auth_backend_http rabbitmq_auth_backend_ldap rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl rabbitmq_consistent_hash_exchange rabbitmq_event_exchange rabbitmq_federation rabbitmq_jms_topic_exchange rabbitmq_mqtt rabbitmq_random_exchange rabbitmq_recent_history_exchange rabbitmq_sharding rabbitmq_shovel rabbitmq_stomp rabbitmq_stream rabbitmq_trust_store rabbitmq_web_dispatch rabbitmq_management_agent rabbitmq_management rabbitmq_prometheus rabbitmq_federation_management rabbitmq_shovel_management rabbitmq_stream_management rabbitmq_top rabbitmq_tracing rabbitmq_web_mqtt rabbitmq_web_mqtt_examples rabbitmq_web_stomp rabbitmq_web_stomp_examples rabbitmq_aws rabbitmq_peer_discovery_common rabbitmq_peer_discovery_aws rabbitmq_peer_discovery_k8s rabbitmq_peer_discovery_consul rabbitmq_peer_discovery_etcd |
| 11 | +jobs: |
| 12 | + build-with-bazel: |
| 13 | + name: bazel build package-generic-unix.tar.xz |
| 14 | + runs-on: ubuntu-latest |
| 15 | + timeout-minutes: 15 |
| 16 | + steps: |
| 17 | + - name: CHECKOUT REPOSITORY |
| 18 | + uses: actions/checkout@v3 |
| 19 | + - name: CONFIGURE ERLANG |
| 20 | + |
| 21 | + with: |
| 22 | + otp-version: ${{ env.erlang_version }} |
| 23 | + elixir-version: ${{ env.elixir_version }} |
| 24 | + - name: CONFIGURE BAZEL |
| 25 | + run: | |
| 26 | + cat << EOF >> user.bazelrc |
| 27 | + build --disk_cache= |
| 28 | + build --color=yes |
| 29 | + EOF |
| 30 | + - name: BUILD package-generic-unix.tar.xz |
| 31 | + run: | |
| 32 | + bazelisk build //:package-generic-unix |
| 33 | + - name: RESOLVE ARCHIVES_DIR |
| 34 | + run: | |
| 35 | + echo "archives_dir=$(readlink -f bazel-bin)" >> $GITHUB_ENV |
| 36 | + - name: UPLOAD package-generic-unix.tar.xz |
| 37 | + |
| 38 | + with: |
| 39 | + name: bazel-package-generic-unix.tar.xz |
| 40 | + path: ${{ env.archives_dir }}/package-generic-unix.tar.xz |
| 41 | + if-no-files-found: error |
| 42 | + |
| 43 | + build-with-make: |
| 44 | + name: make package-generic-unix.tar.xz |
| 45 | + runs-on: ubuntu-latest |
| 46 | + timeout-minutes: 15 |
| 47 | + steps: |
| 48 | + - name: CHECKOUT REPOSITORY |
| 49 | + uses: actions/checkout@v3 |
| 50 | + with: |
| 51 | + path: rabbitmq |
| 52 | + - name: CONFIGURE ERLANG |
| 53 | + |
| 54 | + with: |
| 55 | + otp-version: ${{ env.erlang_version }} |
| 56 | + elixir-version: ${{ env.elixir_version }} |
| 57 | + - name: BUILD package-generic-unix.tar.xz |
| 58 | + env: |
| 59 | + MAKE: make |
| 60 | + run: | |
| 61 | + $MAKE -C rabbitmq \ |
| 62 | + source-dist \ |
| 63 | + PACKAGES_DIR="$PWD/PACKAGES" \ |
| 64 | + PLUGINS="$PLUGINS" \ |
| 65 | + PROJECT_VERSION="$VERSION" |
| 66 | + $MAKE -C rabbitmq/packaging \ |
| 67 | + package-generic-unix \ |
| 68 | + PACKAGES_DIR="$PWD/PACKAGES" \ |
| 69 | + VERSION="$VERSION" |
| 70 | + - name: UPLOAD package-generic-unix.tar.xz |
| 71 | + |
| 72 | + with: |
| 73 | + name: make-package-generic-unix.tar.xz |
| 74 | + path: PACKAGES/rabbitmq-server-generic-unix-*.tar.xz |
| 75 | + if-no-files-found: error |
| 76 | + |
| 77 | + compare: |
| 78 | + needs: |
| 79 | + - build-with-bazel |
| 80 | + - build-with-make |
| 81 | + name: Compare package-generic-unix.tar.xz |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 10 |
| 84 | + steps: |
| 85 | + - name: CHECKOUT REPOSITORY |
| 86 | + uses: actions/checkout@v3 |
| 87 | + with: |
| 88 | + path: rabbitmq-server |
| 89 | + - name: CONFIGURE ERLANG |
| 90 | + |
| 91 | + with: |
| 92 | + otp-version: ${{ env.erlang_version }} |
| 93 | + elixir-version: ${{ env.elixir_version }} |
| 94 | + - name: DOWNLOAD bazel-package-generic-unix.tar.xz |
| 95 | + uses: actions/download-artifact@v3 |
| 96 | + with: |
| 97 | + name: bazel-package-generic-unix.tar.xz |
| 98 | + - name: DOWNLOAD make-package-generic-unix.tar.xz |
| 99 | + uses: actions/download-artifact@v3 |
| 100 | + with: |
| 101 | + name: make-package-generic-unix.tar.xz |
| 102 | + - name: EXPAND & COMPARE |
| 103 | + run: | |
| 104 | + mkdir bazel |
| 105 | + pushd bazel |
| 106 | + tar -xf ${{ github.workspace }}/package-generic-unix.tar.xz |
| 107 | + find . | sort > ${{ github.workspace }}/bazel.manifest |
| 108 | + popd |
| 109 | +
|
| 110 | + mkdir make |
| 111 | + pushd make |
| 112 | + tar -xf ${{ github.workspace }}/rabbitmq-server-generic-unix-*.tar.xz |
| 113 | + # delete an empty directory |
| 114 | + rm -d rabbitmq_server-*/plugins/rabbitmq_random_exchange-*/include |
| 115 | + find . | sort > ${{ github.workspace }}/make.manifest |
| 116 | + popd |
| 117 | +
|
| 118 | + tree -L 2 bazel |
| 119 | + tree -L 2 make |
| 120 | +
|
| 121 | + sleep 1 |
| 122 | +
|
| 123 | + set -x |
| 124 | +
|
| 125 | + ./rabbitmq-server/tools/compare_dist.sh make bazel |
0 commit comments