Skip to content

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- main
- dev
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
run-shell-script:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine if specific files were changed
run: |

Check failure on line 31 in .github/workflows/unit_test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/unit_test.yml

Invalid workflow file

You have an error in your yaml syntax on line 31
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '^(chatlearn|tests)/'; then
echo "CHANGES_DETECTED=true"
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
else
echo "CHANGES_DETECTED=false"
echo "CHANGES_DETECTED=false" >> $GITHUB_ENV
fi
- name: Run unit test
if: env.CHANGES_DETECTED == 'true'
run: |
containers=$(docker ps -aqf "name=^chatlearn_ut_")
if [[ -n "$containers" ]]; then
docker rm $containers -f
fi
docker pull $UT_IMAGE
docker run -v $PWD:$PWD -w $PWD --name chatlearn_ut_$(date '+%d_%m_%Y_%H_%M_%S') --net host --ipc host --shm-size 80G -t --rm --gpus all $UT_IMAGE bash -c 'make test'
env:
UT_IMAGE: ${{ secrets.UT_IMAGE }}