Merge pull request #5 from piyush-jaiswal/feature/add-tests-workflow-… #5
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 | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| id: cp312 | |
| with: | |
| python-version-file: ".python-version" | |
| cache: "pip" | |
| cache-dependency-path: "requirements-test.txt" | |
| # for testing | |
| - name: Check cache hit | |
| run: echo "${{ steps.cp312.outputs.cache-hit }}" # true if cache-hit occurred on the primary key | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-test.txt | |
| - name: Run tests | |
| run: | | |
| pytest --disable-warnings -q -rA |