install dotnet for testing deps/rabbit #32
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
#@ load("@ytt:data", "data") | |
#@yaml/text-templated-strings | |
#@ def job_names(plugins): | |
#@ names = [] | |
#@ for p in plugins: | |
#@ names.append("test-"+p) | |
#@ end | |
#@ return names | |
#@ end | |
#@ def test_plugin(name, needs, suites): | |
test-(@= name @): | |
name: Test (@= name @) | |
needs: #@ needs | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
otp_version: | |
- 26.2 | |
metadata_store: | |
- mnesia | |
- khepri | |
timeout-minutes: 180 | |
env: | |
SUCCESS_PATH: /home/runner/test-result-cache/(@= name @)/${{ matrix.metadata_store }}/${{ matrix.otp_version }} | |
steps: | |
#@ if name == "rabbit": | |
- name: INSTALL DOTNET | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y dotnet-sdk-6.0 | |
#@ end | |
- name: RESTORE BUILT REPO | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }} | |
key: ${{ runner.os }}-make-cache-${{ needs.load-test-result-cache.outputs.hash }} | |
fail-on-cache-miss: true | |
- name: RESTORE TEST RESULT CACHE | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/test-result-cache/ | |
key: ${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | |
restore-keys: | | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ needs.prepare.outputs.previous_run_attempt }} | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}- | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}- | |
- name: PRINT CACHED RESULTS | |
run: | | |
set -x | |
tree /home/runner/test-result-cache | |
- name: SETUP ERLANG/ELIXIR | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.otp_version }} | |
elixir-version: 1.15 | |
- name: PREPARE | |
run: | | |
mkdir -p ${{ env.SUCCESS_PATH }} | |
- name: XREF | |
run: | | |
if [[ -f ${{ env.SUCCESS_PATH }}/xref ]]; then | |
echo "xref already passed for this key ${{ needs.prepare.outputs.hash }}" | |
else | |
make -C deps/(@= name @) \ | |
xref \ | |
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | |
touch ${{ env.SUCCESS_PATH }}/xref | |
fi | |
- name: DIALYZE | |
run: | | |
if [[ -f ${{ env.SUCCESS_PATH }}/dialyze ]]; then | |
echo "dialyze already passed for this key ${{ needs.prepare.outputs.hash }}" | |
else | |
make -C deps/(@= name @) \ | |
dialyze \ | |
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | |
touch ${{ env.SUCCESS_PATH }}/dialyze | |
fi | |
continue-on-error: #@ name == "rabbitmq_ct_helpers" or name == "trust_store_http" | |
- name: EUNIT | |
run: | | |
if [[ -f ${{ env.SUCCESS_PATH }}/eunit ]]; then | |
echo "eunit already passed for this key ${{ needs.prepare.outputs.hash }}" | |
else | |
make -C deps/(@= name @) \ | |
eunit \ | |
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | |
touch ${{ env.SUCCESS_PATH }}/eunit | |
fi | |
#@ for suite in suites: | |
- name: CT (@= suite @) | |
run: | | |
if [[ -f ${{ env.SUCCESS_PATH }}/ct-(@= suite @) ]]; then | |
echo "ct-(@= suite @) already passed for this key ${{ needs.prepare.outputs.hash }}" | |
else | |
make -C deps/(@= name @) \ | |
ct-(@= suite @) \ | |
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | |
touch ${{ env.SUCCESS_PATH }}/ct-(@= suite @) | |
fi | |
#@ end | |
- name: SAVE CACHE COPY | |
if: always() | |
uses: actions/[email protected] | |
with: | |
name: trc-(@= name @)-${{ matrix.metadata_store }}-${{ matrix.otp_version }} | |
path: | | |
/home/runner/test-result-cache | |
- name: UPLOAD TEST ARTIFACTS | |
if: always() | |
uses: actions/[email protected] | |
with: | |
name: testlogs-(@= name @)-${{ matrix.metadata_store }}-${{ matrix.otp_version }} | |
path: deps/(@= name @)/logs/* | |
#@ end | |
#@ def test_cli(needs): | |
test-rabbitmq_cli: | |
name: Test rabbitmq_cli | |
needs: #@ needs | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
otp_version: | |
- 26.2 | |
metadata_store: | |
- mnesia | |
- khepri | |
timeout-minutes: 20 | |
env: | |
SUCCESS_PATH: /home/runner/test-result-cache/rabbitmq_cli/${{ matrix.metadata_store }}/${{ matrix.otp_version }} | |
steps: | |
- name: RESTORE BUILT REPO | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }} | |
key: ${{ runner.os }}-make-cache-${{ needs.load-test-result-cache.outputs.hash }} | |
fail-on-cache-miss: true | |
- name: RESTORE TEST RESULT CACHE | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/test-result-cache/ | |
key: ${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | |
restore-keys: | | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ needs.prepare.outputs.previous_run_attempt }} | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}- | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}- | |
- name: PRINT CACHED RESULTS | |
run: | | |
set -x | |
tree /home/runner/test-result-cache | |
- name: SETUP ERLANG/ELIXIR | |
if: steps.check.outputs.passed != 'true' | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.otp_version }} | |
elixir-version: 1.15 | |
- name: PREPARE | |
run: | | |
mkdir -p ${{ env.SUCCESS_PATH }} | |
- name: TEST | |
id: test | |
if: steps.check.outputs.passed != 'true' | |
run: | | |
if [[ -f ${{ env.SUCCESS_PATH }}/checks ]]; then | |
echo "checks already passed for this key ${{ needs.prepare.outputs.hash }}" | |
else | |
make -C deps/rabbitmq_cli \ | |
checks \ | |
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} | |
touch ${{ env.SUCCESS_PATH }}/checks | |
fi | |
- name: SAVE CACHE COPY | |
if: always() | |
uses: actions/[email protected] | |
with: | |
name: trc-rabbitmq_cli-${{ matrix.metadata_store }}-${{ matrix.otp_version }} | |
path: | | |
/home/runner/test-result-cache | |
- name: UPLOAD TEST ARTIFACTS | |
if: always() | |
uses: actions/[email protected] | |
with: | |
name: testlogs-rabbitmq_cli-${{ matrix.metadata_store }}-${{ matrix.otp_version }} | |
path: | | |
deps/rabbitmq_cli/logs/* | |
#@ end | |
--- | |
#@ load("@ytt:template", "template") | |
name: Test (make) | |
on: | |
push: | |
branches: | |
- main | |
- v3.13.x | |
- v3.12.x | |
- v3.11.x | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
hash: ${{ steps.hash.outputs.hash }} | |
previous_run_attempt: ${{ steps.previous-attempt.outputs.number }} | |
steps: | |
- name: CHECKOUT REPOSITORY | |
uses: actions/checkout@v4 | |
- name: SETUP ERLANG/ELIXIR | |
if: steps.check.outputs.passed != 'true' | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 26.2 | |
elixir-version: 1.15 | |
- name: ENSURE WORKFLOWS ARE UP TO DATE | |
run: | | |
mkdir local-bin/ | |
curl -L https://carvel.dev/install.sh | K14SIO_INSTALL_BIN_DIR=local-bin bash | |
make actions-workflows YTT=$PWD/local-bin/ytt | |
git diff --exit-code | |
- name: COMPUTE REPO HASH | |
id: hash | |
run: | | |
echo "hash=${{ hashFiles('**/*', '!.github/**/*', '!*.bazel', '!*.bzl', '!BUILD.*') }}" | tee -a $GITHUB_OUTPUT | |
- name: COMPUTE PREVIOUS RUN ATTEPMT | |
id: previous-attempt | |
run: | | |
PREVIOUS_ATTEMPT=$((${{ fromJSON(github.run_attempt) }} - 1)) | |
echo "number=$PREVIOUS_ATTEMPT" | tee -a $GITHUB_OUTPUT | |
- name: CACHE BUILT REPO | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }} | |
key: ${{ runner.os }}-make-cache-${{ steps.hash.outputs.hash }} | |
- name: BUILD | |
run: | | |
make | |
#@ for plugin in data.values.internal_deps: | |
_: #@ template.replace(test_plugin(plugin, ["prepare"], data.values[plugin].suites)) | |
#@ end | |
_: #@ template.replace(test_plugin("rabbit", ["prepare"] + job_names(data.values.internal_deps), data.values.rabbit.suites)) | |
_: #@ template.replace(test_cli(["prepare", "test-rabbit"])) | |
#@ for plugin in data.values.tier1_plugins: | |
_: #@ template.replace(test_plugin(plugin, ["prepare", "test-rabbitmq_cli"], data.values[plugin].suites)) | |
#@ end | |
summary-test-make: | |
if: always() | |
needs: #@ ["prepare", "test-rabbit", "test-rabbitmq_cli"] + job_names(data.values.internal_deps + data.values.tier1_plugins) | |
runs-on: ubuntu-latest | |
steps: | |
- name: RESTORE TEST RESULT CACHE | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/test-result-cache/ | |
key: ${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | |
restore-keys: | | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ needs.prepare.outputs.previous_run_attempt }} | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}- | |
${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}- | |
- name: UPDATE CACHE | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: trc-* | |
path: /home/runner/test-result-cache | |
merge-multiple: true | |
- name: PRINT RESULTS | |
run: | | |
set -x | |
tree /home/runner/test-result-cache | |
- name: SAVE TEST RESULT CACHE | |
uses: actions/cache/save@v3 | |
with: | |
path: /home/runner/test-result-cache/ | |
key: ${{ runner.os }}-test-result-cache-${{ needs.prepare.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | |
- name: SUMMARY | |
run: | | |
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)' | |
${{ toJson(needs) }} | |
EOF |