-
Notifications
You must be signed in to change notification settings - Fork 24
55 lines (51 loc) · 1.74 KB
/
validate.yml
File metadata and controls
55 lines (51 loc) · 1.74 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
name: Validate Framework
on:
pull_request:
paths:
- 'frameworks/**'
- 'scripts/validate.sh'
- 'scripts/validate-ws.py'
jobs:
detect:
runs-on: ubuntu-latest
outputs:
frameworks: ${{ steps.find.outputs.frameworks }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: find
run: |
frameworks=$(git diff --name-only origin/${{ github.base_ref }}...HEAD \
| grep '^frameworks/' \
| cut -d'/' -f2 \
| sort -u \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "frameworks=$frameworks" >> "$GITHUB_OUTPUT"
runner-busy:
needs: detect
if: needs.detect.outputs.frameworks != '[]' && vars.RUNNER_LOCAL == 'true'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Post runner-busy notice
run: |
gh pr comment "${{ github.event.pull_request.number }}" \
--repo "${{ github.repository }}" \
--body "⏸️ Runner is currently performing local benchmark runs and is disabled for GitHub Actions, please try later or check our Discord announcements on runner state for more info."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
validate:
needs: detect
if: needs.detect.outputs.frameworks != '[]' && vars.RUNNER_LOCAL != 'true'
runs-on: self-hosted
# environment: runner # uncomment to require approval for validation runs
timeout-minutes: 30
strategy:
matrix:
framework: ${{ fromJson(needs.detect.outputs.frameworks) }}
steps:
- uses: actions/checkout@v5
- name: Validate ${{ matrix.framework }}
run: ./scripts/validate.sh "${{ matrix.framework }}"