Skip to content

Commit

Permalink
Activating venv in CI (#100)
Browse files Browse the repository at this point in the history
This avoids requiring repetitive `poetry run` usage, and slightly speed
up steps.
It might make #99 work too.
  • Loading branch information
etianen committed Feb 11, 2024
1 parent 7bebb2f commit 1a0a2ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ runs:
shell: bash
- run: poetry check --lock
shell: bash
# Activate venv.
- run: |
VIRTUAL_ENV=$(poetry env info --path)
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
shell: bash
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ jobs:
- name: Install dependencies
run: poetry install --no-root --all-extras
- name: Install lib versions
run: poetry run pip install -e .[pytest,trio] ${{ matrix.lib-versions }}
run: pip install -e .[pytest,trio] ${{ matrix.lib-versions }}
# Run checks.
- name: Check (ruff)
run: poetry run ruff check
run: ruff check
- name: Check (ruff format)
run: poetry run ruff format --check
run: ruff format --check
- name: Check (mypy)
run: poetry run mypy
run: mypy
# Run tests.
- name: Test
run: poetry run coverage run -m pytest
run: coverage run -m pytest
# Upload coverage.
- name: Upload coverage
uses: actions/upload-artifact@v4
Expand All @@ -74,7 +74,7 @@ jobs:
run: poetry install --all-extras --only main --only docs
# Build docs.
- name: Build docs
run: poetry run sphinx-build -W docs docs/_build
run: sphinx-build -W docs docs/_build

report:
runs-on: ubuntu-latest
Expand All @@ -97,9 +97,9 @@ jobs:
pattern: .coverage.*
merge-multiple: true
- name: Combine coverage
run: poetry run coverage combine .coverage.*
run: coverage combine .coverage.*
- name: Report coverage
run: poetry run coverage report
run: coverage report
# Fail if any `needs` job was not a success.
# Along with `if: always()`, this allows this job to act as a single required status check for the entire workflow.
- name: Fail on workflow error
Expand Down

0 comments on commit 1a0a2ef

Please sign in to comment.