Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaOfOcean committed Sep 3, 2024
1 parent f417c56 commit e70f3b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- v[0-9]+.[0-9]+.[0-9]+

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -26,10 +26,18 @@ jobs:
runs-on: self-hosted

steps:
- name: Check for 2 approvals
id: approvals
run: |
REVIEW_API_URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews"
reviews=$(curl -s -H "Authorization: token ${{ secrets._GITHUB_TOKEN }}" $REVIEW_API_URL)
approve_count=$(echo "$reviews" | jq '[.[] | select(.state == "APPROVED")] | length')
echo "approve_count=$approve_count" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3

- name: Run unit test
if: env.approve_count == '2'
run: |
docker pull $UT_IMAGE
docker run -v $PWD:$PWD -w $PWD --net host --ipc host --shm-size 80G -t --rm --gpus all $UT_IMAGE bash -c 'make test'
Expand Down

0 comments on commit e70f3b5

Please sign in to comment.