add solution isMonotonic python #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "is_typescript=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "No TypeScript files found" | |
echo "is_typescript=false" >> "$GITHUB_OUTPUT" | |
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 | |
if: steps.ts-files.outputs.is_typescript == 'false' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run Python tests | |
if: steps.ts-files.outputs.is_typescript == 'false' | |
run: python -m unittest discover -p '*_test.py' | |