Merge pull request #2 from tahzeer/develop #4
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: Test and coverage (core) | |
| # Runs the SPAR core test suites. Triggered only when core/ (or this workflow) | |
| # changes, so deployment/docker/doc edits don't run the python tests. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'core/**' | |
| - '.github/workflows/core-test.yml' | |
| push: | |
| paths: | |
| - 'core/**' | |
| - '.github/workflows/core-test.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: check-core-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-mapper-core: | |
| name: Test Mapper Core with Python ${{ matrix.py }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| py: | |
| - "3.11" | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: openg2p | |
| POSTGRES_PASSWORD: openg2p | |
| POSTGRES_DB: openg2p | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python ${{ matrix.py }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.py }} | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-auth-models | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-auth | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-common | |
| pip install pytest pytest-asyncio pytest-cov | |
| pip install -e ./core/models | |
| pip install -e ./core/mapper-core | |
| - name: Run Mapper Core tests | |
| working-directory: core/mapper-core | |
| run: | | |
| pytest tests/ -v --cov=openg2p_spar_mapper_core --cov-report=xml --cov-report=term-missing | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./core/mapper-core/coverage.xml | |
| flags: mapper-core | |
| name: mapper-core-py${{ matrix.py }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-bene-portal-api: | |
| name: Test Bene Portal API with Python ${{ matrix.py }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| py: | |
| - "3.11" | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: openg2p | |
| POSTGRES_PASSWORD: openg2p | |
| POSTGRES_DB: openg2p | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python ${{ matrix.py }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.py }} | |
| cache: 'pip' | |
| - name: Install external dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-auth-models | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-auth | |
| pip install git+https://github.com/openg2p/openg2p-fastapi-common@v1.1.4#subdirectory=openg2p-fastapi-common | |
| - name: Install local dependencies | |
| run: | | |
| pip install pytest pytest-asyncio pytest-cov | |
| pip install -e ./core/models | |
| pip install -e ./core/mapper-core | |
| pip install -e ./core/bene-portal-api | |
| - name: Run Bene Portal API tests | |
| working-directory: core/bene-portal-api | |
| run: | | |
| pytest tests/ -v --cov=openg2p_spar_bene_portal_api --cov-report=xml --cov-report=term-missing | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./core/bene-portal-api/coverage.xml | |
| flags: bene-portal-api | |
| name: bene-portal-api-py${{ matrix.py }} | |
| token: ${{ secrets.CODECOV_TOKEN }} |