refactor: Update async tests to use asyncio.run instead of `pytest.…
#12
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: CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| name: Test on Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # If a constraints.txt file is present, use it to pin critical dependency versions. | |
| if [ -f constraints.txt ]; then | |
| pip install -e ".[dev]" -c constraints.txt | |
| else | |
| pip install -e ".[dev]" | |
| fi | |
| - name: Lint with Ruff | |
| run: | | |
| ruff check src/ tests/ | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=apcore_toolkit --cov-report=term-missing --cov-report=xml | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: coverage-report | |
| path: coverage.xml |