Also template test-make.yaml #1
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 | ||
--- | ||
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: | ||
load-test-result-cache: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
hash: ${{ steps.hash.outputs.hash }} | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
uses: actions/checkout@v4 | ||
- name: ENSURE WORKFLOWS ARE UP TO DATE | ||
run: | | ||
make actions-workflows | ||
git diff --exit-code | ||
- name: COMPUTE REPO HASH | ||
id: hash | ||
run: | | ||
echo "hash=${{ hashFiles('**/*', '!.github/**/*', '!*.bazel', '!*.bzl', '!BUILD.*') }}" | tee -a $GITHUB_OUTPUT | ||
- name: MOUNT TEST RESULT CACHE | ||
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
save-always: true | ||
- name: PREP CACHE DIR | ||
run: | | ||
mkdir -p /home/runner/test-result-cache/${{ steps.hash.outputs.hash }} | ||
touch /home/runner/test-result-cache/marker | ||
- name: UPLOAD IT AS AN ARTIFACT | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-result-cache-subdir | ||
#! force the archive to include the sha | ||
#! by controlling the common prefix | ||
path: | | ||
/home/runner/test-result-cache/marker | ||
/home/runner/test-result-cache/${{ steps.hash.outputs.hash }} | ||
retention-days: 1 | ||
#@ for plugin in data.values.internal_deps: | ||
test-(@= plugin @): | ||
needs: | ||
- load-test-result-cache | ||
uses: ./.github/workflows/test-(@= plugin @).yaml | ||
with: | ||
trc: /home/runner/test-result-cache | ||
hash: ${{ needs.load-test-result-cache.outputs.hash }} | ||
ignore-dialyze-errors: #@ plugin == 'rabbitmq_ct_helpers' or plugin == 'trust_store_http' | ||
#@ end | ||
test-rabbit: | ||
needs: #@ ["load-test-result-cache"] + job_names(data.values.internal_deps) | ||
uses: ./.github/workflows/test-rabbit.yaml | ||
with: | ||
trc: /home/runner/test-result-cache | ||
hash: ${{ needs.load-test-result-cache.outputs.hash }} | ||
test-rabbitmq_cli: | ||
needs: | ||
- load-test-result-cache | ||
- test-rabbit | ||
uses: ./.github/workflows/test-rabbitmq_cli.yaml | ||
with: | ||
trc: /home/runner/test-result-cache | ||
hash: ${{ needs.load-test-result-cache.outputs.hash }} | ||
#@ for plugin in data.values.tier1_plugins: | ||
test-(@= plugin @): | ||
needs: | ||
- load-test-result-cache | ||
- test-rabbitmq_cli | ||
uses: ./.github/workflows/test-(@= plugin @).yaml | ||
with: | ||
trc: /home/runner/test-result-cache | ||
hash: ${{ needs.load-test-result-cache.outputs.hash }} | ||
#@ end | ||
summary-test-make: | ||
if: always() | ||
needs: #@ ["load-test-result-cache", "test-rabbit", "test-rabbitmq_cli"] + job_names(data.values.internal_deps + data.values.tier1_plugins) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: MOUNT TEST RESULT CACHE | ||
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ needs.load-test-result-cache.outputs.hash }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
save-always: true | ||
- 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/${{ needs.load-test-result-cache.outputs.hash }} | ||
- name: SUMMARY | ||
run: | | ||
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)' | ||
${{ toJson(needs) }} | ||
EOF |