This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
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.
* build: add pytest as dev dependency * test: exemplary unit test * build: add pytest-cov as dev dependency * chore: ignore outputs of pytest * ci: run pytest on pull requests or pushes to main * build: use older structure for dev dependencies
- Loading branch information
1 parent
b436e7b
commit d9d3f62
Showing
6 changed files
with
552 additions
and
133 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,53 @@ | ||
name: Main | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./package_parser | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
# Requires installation of pytest and pytest-cov | ||
- name: Test with pytest | ||
run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=html | ||
|
||
- name: Upload test coverage | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Test coverage | ||
path: package_parser/htmlcov |
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,58 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./package_parser | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
# Requires installation of pytest and pytest-cov | ||
- name: Test with pytest | ||
run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=html | ||
|
||
- name: Upload test coverage | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Test coverage | ||
path: package_parser/htmlcov |
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
Oops, something went wrong.