-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for running pytest (#54)
* Fix pytest * Remove collect_ignore * Import function from correct module in test_horizontal_mean.py * Add GitHub Actions workflow for running pytest
- Loading branch information
1 parent
0bf11aa
commit b372c34
Showing
3 changed files
with
39 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Python Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger the workflow when changes are pushed to the main branch | ||
pull_request: | ||
branches: | ||
- main # Trigger the workflow on pull requests targeting the main branch | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest # Use the latest Ubuntu runner for the job | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Step 2: Set up Python (using a version from your project, e.g., 3.11) | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' # Set the Python version you want to use | ||
|
||
# Step 3: Install dependencies (e.g., from requirements.txt) | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# Step 4: Run pytest | ||
- name: Run pytest | ||
run: | | ||
pytest --maxfail=1 --disable-warnings -v # You can customize pytest flags here | ||
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
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