Skip to content

feat(metrics): add near-duplicate block detection #11

feat(metrics): add near-duplicate block detection

feat(metrics): add near-duplicate block detection #11

name: Sync Behavior Coverage
on:
pull_request:
branches: [main]
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout PR branch
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "27.3"
elixir-version: "1.19"
- name: Cache deps
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-dev-otp27.3-elixir1.19-${{ hashFiles('mix.lock', 'mix.exs') }}
restore-keys: ${{ runner.os }}-mix-dev-otp27.3-elixir1.19-
- name: Install dependencies
run: mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
- name: Regenerate language coverage
run: mix codeqa.sample_report --apply-languages
- name: Regenerate scalar vectors
run: mix codeqa.sample_report --apply-scalars
- name: Check for YAML drift
id: diff
run: |
if git diff --quiet priv/combined_metrics/; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push updated YAMLs
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add priv/combined_metrics/*.yml
git commit -m "chore(combined-metrics): sync language coverage and scalar vectors [skip ci]"
git push