forked from MontpellierRessourcesImagerie/microscope-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
cade8da
commit bf91ea1
Showing
2 changed files
with
75 additions
and
0 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,30 @@ | ||
name: Run Tests on PR | ||
on: pull_request | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/ | ||
coverage report | ||
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,45 @@ | ||
name: Run Tests on push | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/ | ||
coverage report | ||
# - name: Test with pytest and generate coverage report/badge | ||
# run: | | ||
# pip install coverage coverage-badge | ||
# coverage run -m pytest tests/ | ||
# coverage report -i | ||
# coverage-badge -f -o coverage.svg | ||
# - name: Commit badge | ||
# run: | | ||
# git config --global user.name 'Erick Ratamero' | ||
# git config --global user.email '[email protected]' | ||
# git add coverage.svg | ||
# git commit --allow-empty -am "Automated updating coverage badge" | ||
# git push | ||
|