-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.15 KB
/
main.yml
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
name: Run Tests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: Run Jest tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for Typescript files
id: ts-files
run: |
is_typescript=$(find . -name '*.ts' -print -quit)
if [ -n "$is_typescript" ]; then
echo "Found TypeScript files"
echo "::set-output name=ts_files::true"
else
echo "No TypeScript files found"
echo "::set-output name=ts_files::false"
fi
- name: Install dependencies and run Jest
if: steps.ts-files.outputs.is_typescript == 'true'
run: npm install |
npm test -- --coverage --ci
- name: Set up Python and run unit test
if: steps.ts-files.outputs.is_typescript == 'false'
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Run Python tests
if: steps.ts-files.outputs.is_typescript == 'false'
run: python -m unittest discover -p '*_test.py'