Skip to content

Commit

Permalink
update github workflow to run python unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ragmha committed May 5, 2024
1 parent 8bc2686 commit 3d192ce
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,35 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for ts files
id: file-type
run: |
is_typescript=$(find . -name '*.ts' -print -quit)
if [ -n "$is_typescript"]; then
echo "Is Typescript"
echo "::set-output name=is_typescript::true"
else
echo "Is not Typescript"
echo "::set-output name=is_typescript::false"
end
- name: Install dependencies
if: steps.file-type.outputs.is_typescript == 'true'
run: npm install

- name: Run Jest tests
if: steps.file-type.outputs.is_typescript == 'true'
run: npm test -- --coverage --ci

- name: Set up Python
if: steps.file-type.outputs.is_typescript == 'false'
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Run Python tests
if: steps.file-type.outputs.is_typescript == 'false'
run: python -m unittest discover -p '*_test.py'
Empty file added requirements.txt
Empty file.

0 comments on commit 3d192ce

Please sign in to comment.