-
Notifications
You must be signed in to change notification settings - Fork 8
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
341c9ba
commit f7c369c
Showing
3 changed files
with
84 additions
and
44 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
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
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 |
---|---|---|
@@ -1,26 +1,51 @@ | ||
name: Tests | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
python-version: ['3.10', '3.11', '3.12'] | ||
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 dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
poetry config virtualenvs.create false --local | ||
poetry install | ||
- name: Run tests | ||
run: | | ||
pytest -s --cov=blackscholes --cov-report term-missing --cov-config=.coveragerc | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install uv | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
- name: Create and activate virtual environment | ||
run: | | ||
uv venv | ||
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
uv pip install 'setuptools[pkg_resources]' | ||
uv pip install -e ".[test]" | ||
- name: Run tests with coverage | ||
run: | | ||
uv pip install pytest-cov | ||
pytest -s tests/ --cov=blackscholes --cov-report term-missing | ||
- name: Build wheel | ||
run: | | ||
uv pip install build | ||
python -m build --wheel | ||
- name: Install built wheel | ||
run: | | ||
uv pip install dist/*.whl |