Skip to content

Commit

Permalink
add action for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
fs committed Jan 18, 2024
1 parent 83c99aa commit 768158b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Python application test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
pip install -r requirements.txt
- name: Test with pytest
run: |
pytest
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
基于最小项目原则,介绍编程语言的一些特性和实践
基于最小项目原则,介绍编程语言的一些特性和实践

### pytest
```
pytest pytest_mini_project/test_simplemath.py
```

0 comments on commit 768158b

Please sign in to comment.