fix ci/cd for github #8
  
    
      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 Pipeline | ||
| on: | ||
| push: | ||
| branches: | ||
| - "main" | ||
| - "staging" | ||
| - "documentation" | ||
| pull_request: | ||
| branches: | ||
| - "main" | ||
| - "staging" | ||
| - "documentation" | ||
| workflow_dispatch: # Allows manual triggering | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| env: | ||
| FORCE_COLOR: 3 # Enables colored output | ||
| jobs: | ||
| test: | ||
| name: ${{ matrix.os }} | py${{ matrix.python-version }} | ||
| runs-on: ${{ matrix.os }} | ||
| needs: detect-ci-trigger | ||
| if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
| python-version: ["3.8", "3.10", "3.12"] | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Python Environment | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| - name: Install Dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install --no-cache-dir -e . | ||
| python -m pip install pytest pytest-cov flake8 pytest-xdist | ||
| - name: Run Linting (Flake8) | ||
| run: flake8 gedidb | ||
| - name: Run Tests | ||
| run: | | ||
| pytest -n 4 --timeout=180 \ | ||
| --cov=gedidb --cov-branch --cov-report=xml --cov-report=term \ | ||
| --junitxml=pytest.xml | ||
| - name: Upload Test Results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Test Results (${{ matrix.os }} - py${{ matrix.python-version }}) | ||
| path: pytest.xml | ||
| - name: Upload Code Coverage to Codecov | ||
| uses: codecov/codecov-action@v5.3.1 | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| env_vars: RUNNER_OS,PYTHON_VERSION | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
| event_file: | ||
| name: "Event File" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Upload GitHub Event File | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Event File | ||
| path: ${{ github.event_path }} | ||