Merge pull request #179 from OpenTerrace/development #32
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 workflow will install the dependencies and run the tests when a push is made to the main branch or when the workflow is manually triggered. | |
name: Run pytest | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
test-pip: | |
name: Run test matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version-file: ['pyproject.toml'] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Fetch all tags | |
run: git fetch --prune --unshallow --tags | |
- name: Extract Python version and save as env variable | |
id: python-version | |
run: | | |
file_path="${{ github.workspace }}/${{ matrix.python-version-file }}" | |
version=$(awk -F'=' '/^python/ {print $2}' "$file_path" | tr -d '~' | xargs) | |
echo "Python version extracted: $version" | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Set up Python ${{ env.version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
pip install poetry | |
- name: Install OpenTerrace | |
run: | | |
poetry install | |
- name: Run tests | |
run: | | |
poetry run pytest -n auto |