forked from FlagOpen/FlagGems
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.15 KB
/
model-test.yaml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: model-test
on:
workflow_call:
jobs:
model-test:
runs-on: jiuding
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check GPU free
shell: bash
run: tools/gpu_check.sh
- name: FlagGems examples
shell: bash
run: |
echo "current dir: $(pwd)"
git config --global --add safe.directory ../FlagGems
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "This is a pull request event. PR number is ${{ github.event.pull_request.number }}"
PR_ID=${{ github.event.pull_request.number }}
elif [ "${{ github.event_name }}" == "push" ]; then
PR_NUMBER=$(git log -1 --pretty=format:'%s' | grep -oE '#[0-9]+' | grep -oE '[0-9]+')
echo "This is a push event. The relate PR number is ${PR_NUMBER}"
PR_ID=${PR_NUMBER}
fi
bash tools/model-test.sh ${PR_ID}