ci.yaml updated to use python #1
  
    
      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 - Testing and Code Coverage | ||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
| outputs: | ||
| test-result: | ||
| description: "Test execution result" | ||
| value: ${{ jobs.code-coverage.outputs.result }} | ||
| env: | ||
| MONGO_URI: ${{ secrets.MONGO_URI }} | ||
| MONGO_USERNAME: ${{ secrets.MONGO_USERNAME }} | ||
| MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }} | ||
| jobs: | ||
| unit-testing: | ||
| name: Unit Testing | ||
| strategy: | ||
| matrix: | ||
| python-version: [3.9, 3.10, 3.11] | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| exclude: | ||
| - os: windows-latest | ||
| node-version: 3.9 | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Puthon Version - ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install Dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pytest pytest-cov | ||
| - name: Unit Testing | ||
| id: Python-unit-testing-step | ||
| run: pytest --junitxml=test-results.xml | ||
| - name: Archive Test Result | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Mocha-Test-Result-${{ matrix.os }}-${{ matrix.python-version }} | ||
| path: test-results.xml | ||
| retention-days: 1 | ||
| code-coverage: | ||
| name: Code Coverage | ||
| needs: unit-testing | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| result: ${{ steps.coverage.outcome }} | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install Dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pytest pytest-cov | ||
| - name: Run Code Coverage | ||
| id: coverage | ||
| continue-on-error: true | ||
| run: pytest --cov=. --cov-report=xml --cov-report=html | ||
| - name: Archive Coverage Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Coverage-Report | ||
| path: coverage/ | ||
| retention-days: 1 | ||