Skip to content

initial PR workflow. #1

initial PR workflow.

initial PR workflow. #1

name: test-on-PR

Check failure on line 1 in .github/workflows/test-on-pull-request.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-on-pull-request.yaml

Invalid workflow file

`push pull_request workflow_dispatch` is not a valid event name
on: [push pull_request workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
steps:
# check out repo; set up recent python
- name: Check out repo
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v
with:
python-version: '3.12'
# install and configure poetry
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# load cached venv if it exsists
- 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 when no cache
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
# install the project
- name: Install n100tickers
run: poetry install --no-interaction
# now test
- name: Run test suite
run: |
source .venv/bin/activate
pytest