MSD diff #89
Workflow file for this run
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
name: MSD Diff | |
on: | |
pull_request: | |
branches: | |
- "main" | |
paths: | |
- 'rs/ic-observability/multiservice-discovery*/src/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
msd-diff: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: "🔧 Setup runner" | |
uses: ./.github/workflows/manage-runner-pre | |
- name: "📥 Download main test artifact" | |
uses: dawidd6/[email protected] | |
with: | |
name: test-artifacts | |
branch: main | |
workflow: main.yaml | |
- name: "🔭 Compute MSD" | |
id: msd-diff | |
run: | | |
set -exuo pipefail | |
REGISTRY_DIR_MAIN="$HOME/tmp/main-registry" | |
REGISTRY_DIR_BRANCH="$HOME/tmp/branch-registry" | |
TARGETS_DIR_MAIN="$HOME/main-targets" | |
TARGETS_DIR_BRANCH="$HOME/branch-targets" | |
mkdir -p "$REGISTRY_DIR_MAIN" \ | |
"$REGISTRY_DIR_BRANCH" \ | |
"$TARGETS_DIR_MAIN" \ | |
"$TARGETS_DIR_BRANCH" | |
chmod +x multiservice-discovery | |
# Run multiservice-discovery for main targets | |
./multiservice-discovery \ | |
--targets-dir "$REGISTRY_DIR_MAIN" \ | |
--render-prom-targets-to-stdout > "$TARGETS_DIR_MAIN/targets.json" | |
# Run multiservice-discovery for branch targets with bazel | |
bazel run //rs/ic-observability/multiservice-discovery -- \ | |
--targets-dir "$REGISTRY_DIR_BRANCH" \ | |
--render-prom-targets-to-stdout > "$TARGETS_DIR_BRANCH/targets.json" | |
echo "targets_main=$TARGETS_DIR_MAIN" >> $GITHUB_OUTPUT | |
echo "targets_branch=$TARGETS_DIR_BRANCH" >> $GITHUB_OUTPUT | |
- name: "Check MSD Diff" | |
uses: "int128/diff-action@v1" | |
with: | |
base: ${{ steps.msd-diff.outputs.targets_main }} | |
head: ${{ steps.msd-diff.outputs.targets_branch }} | |
comment-header: | | |
## MSD Diff | |
Remove `prevent-merging-MSD-diff` label to merge after inspection | |
label: prevent-merging-MSD-diff |