Merge pull request #29 from VACLab/work-with-real-data #96
This file contains hidden or 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: Tests and Lint | |
| on: | |
| # Trigger workflow on pull requests to the main branch | |
| pull_request: | |
| branches: | |
| - main | |
| # Trigger workflow on push to the main branch | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| tests: | |
| name: Run Unit Tests and Lint | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| # Step 1: Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Step 3: Install Poetry | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 2.2.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Verify Poetry install | |
| run: | | |
| echo "PATH is: $PATH" | |
| which poetry | |
| poetry --version | |
| # Step 2: Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" # Use project’s Python version | |
| cache: "poetry" | |
| # Step 5: Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| poetry install --with dev | |
| # Step 6: Run Tests | |
| - name: Run tests | |
| run: | | |
| poetry run pytest -s --cov=biasanalyzer --cov-config=.coveragerc | |
| # Step 7: Run Ruff check | |
| - name: Run ruff | |
| run: poetry run ruff check . |