-
Notifications
You must be signed in to change notification settings - Fork 3.9k
155 lines (148 loc) · 5.72 KB
/
check-build-system-equivalence.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Check Bazel/Erlang.mk Equivalence
on:
workflow_call:
inputs:
ref:
required: true
type: string
erlang_version:
required: true
type: string
elixir_version:
required: true
type: string
project_version:
required: true
type: string
workflow_dispatch:
inputs:
erlang_version:
description: 'OTP version to build with'
required: true
default: "26.1"
elixir_version:
description: 'Elixir version to build with'
required: true
default: "1.15"
project_version:
description: 'PROJECT_VERSION used for make'
required: true
default: "3.13.0"
env:
erlang_version: ${{ inputs.erlang_version || github.event.inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version || github.event.inputs.elixir_version }}
VERSION: ${{ inputs.project_version || github.event.inputs.project_version }}
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
EXTRA_PLUGINS: accept amqp_client aten base64url cowboy cowlib credentials_obfuscation cuttlefish eetcd enough gen_batch_server getopt gun jose observer_cli osiris prometheus quantile_estimator ra ranch recon redbug seshat stdout_formatter syslog sysmon_handler systemd thoas
jobs:
build-with-bazel:
name: bazel build package-generic-unix.tar.xz
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1.17
with:
otp-version: ${{ env.erlang_version }}
elixir-version: ${{ env.elixir_version }}
- name: CONFIGURE BAZEL
run: |
cat << EOF >> user.bazelrc
build --disk_cache=
build --color=yes
EOF
- name: BUILD package-generic-unix.tar.xz
run: |
bazelisk build //:package-generic-unix
- name: RESOLVE ARCHIVES_DIR
run: |
echo "archives_dir=$(readlink -f bazel-bin)" >> $GITHUB_ENV
- name: UPLOAD package-generic-unix.tar.xz
uses: actions/upload-artifact@v4.3.1
with:
name: bazel-package-generic-unix-${{ env.VERSION }}.tar.xz
path: ${{ env.archives_dir }}/package-generic-unix.tar.xz
if-no-files-found: error
build-with-make:
name: make package-generic-unix.tar.xz
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
with:
path: rabbitmq
ref: ${{ inputs.ref || github.ref }}
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1.17
with:
otp-version: ${{ env.erlang_version }}
elixir-version: ${{ env.elixir_version }}
- name: BUILD package-generic-unix.tar.xz
env:
MAKE: make
run: |
$MAKE -C rabbitmq \
source-dist \
PACKAGES_DIR="$PWD/PACKAGES" \
PLUGINS="$PLUGINS" \
PROJECT_VERSION="$VERSION"
$MAKE -C rabbitmq/packaging \
package-generic-unix \
PACKAGES_DIR="$PWD/PACKAGES" \
VERSION="$VERSION"
- name: UPLOAD package-generic-unix.tar.xz
uses: actions/upload-artifact@v4.3.1
with:
name: make-package-generic-unix-${{ env.VERSION }}.tar.xz
path: PACKAGES/rabbitmq-server-generic-unix-*.tar.xz
if-no-files-found: error
compare:
needs:
- build-with-bazel
- build-with-make
name: Compare package-generic-unix.tar.xz
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
with:
path: rabbitmq-server
ref: ${{ inputs.ref || github.ref }}
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1.17
with:
otp-version: ${{ env.erlang_version }}
elixir-version: ${{ env.elixir_version }}
- name: DOWNLOAD bazel-package-generic-unix.tar.xz
uses: actions/download-artifact@v4
with:
name: bazel-package-generic-unix-${{ env.VERSION }}.tar.xz
- name: DOWNLOAD make-package-generic-unix.tar.xz
uses: actions/download-artifact@v4
with:
name: make-package-generic-unix-${{ env.VERSION }}.tar.xz
- name: EXPAND & COMPARE
run: |
mkdir bazel
pushd bazel
tar -xf ${{ github.workspace }}/package-generic-unix.tar.xz
find . | sort > ${{ github.workspace }}/bazel.manifest
popd
mkdir make
pushd make
tar -xf ${{ github.workspace }}/rabbitmq-server-generic-unix-*.tar.xz
# delete an empty directory
rm -d rabbitmq_server-*/plugins/rabbitmq_random_exchange-*/include
find . | sort > ${{ github.workspace }}/make.manifest
popd
tree -L 3 bazel
tree -L 3 make
sleep 1
set -x
./rabbitmq-server/tools/compare_dist.sh make bazel