pytest #2
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
name: pytest | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
workflow_dispatch: # used to allow manual triggering | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
if: > | |
github.event.pull_request.merged == true || | |
github.event_name == 'workflow_dispatch' | |
strategy: | |
matrix: | |
python-version: [3.10] | |
steps: | |
- 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 | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: poetry install | |
- name: Run pytest | |
run: poetry run pytest |