-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,33 @@ | ||
name: Run tests | ||
name: pytest Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- main | ||
pull_request: | ||
branches: | ||
- "main" | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
matrix: | ||
# Run in all these versions of Python | ||
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10.0'] | ||
pytest_job: | ||
name: Run pytest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the latest code from the repo | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
# Setup which version of Python to use | ||
- name: Set Up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -r requirements.txt | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# Display the Python version being used | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
# Install the package using the setup.py | ||
- name: Install package | ||
run: python setup.py install | ||
# Install pytest (you can use some other testing utility) | ||
- name: Install pytest, and requirements | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest | ||
# Run the tests. I'm using pytest and the file is in the tests directory. | ||
- name: Run tests | ||
run: pytest tests/test* | ||
- name: Run pytest | ||
run: | | ||
pytest |