-
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
2882e5e
commit bb2850b
Showing
1 changed file
with
47 additions
and
31 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 |
---|---|---|
|
@@ -9,41 +9,57 @@ jobs: | |
|
||
# Define job steps | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
id: setup-python | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Check-out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
python-version: '3.12' | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install package | ||
run: poetry install | ||
|
||
- name: Format with ruff | ||
run: poetry run ruff format | ||
|
||
- name: Lint with ruff | ||
run: poetry run ruff check --fix | ||
|
||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/ --cov=chaturbate_poller --cov-report=xml | ||
- name: Use Codecov to track coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
#---------------------------------------------- | ||
# run test suite and output coverage file | ||
#---------------------------------------------- | ||
- name: Test with pytest | ||
run: poetry run pytest --cov=chaturbate_poller --cov-report=xml | ||
#---------------------------------------------- | ||
# upload coverage stats | ||
# (requires CODECOV_TOKEN in repository secrets) | ||
#---------------------------------------------- | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: MountainGod2/chaturbate_poller | ||
token: ${{ secrets.CODECOV_TOKEN }} # Only required for private repositories | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
|
||
- name: Build documentation | ||
run: poetry run make clean html --directory docs/ | ||
|