Add simple frictional inelastic ball-ball collision model #80
Workflow file for this run
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: test | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.12"] | |
poetry-version: ["1.8.3"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install project dependencies | |
run: poetry install | |
env: | |
# Don't give up too soon | |
POETRY_REQUESTS_TIMEOUT: '120' | |
- name: Run tests | |
run: poetry run pytest | |
# Calculate the test coverage | |
- name: Generate coverage report | |
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' | |
run: | | |
poetry run pytest --cov=pooltool --cov-report=xml | |
# Upload coverage to Codecov | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: service | |
name: service-${{ github.run_id }} | |
fail_ci_if_error: true | |
verbose: true |