-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.78 KB
/
sync-behavior-coverage.yml
File metadata and controls
65 lines (53 loc) · 1.78 KB
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
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