Skip to content

fix ci/cd for github #8

fix ci/cd for github

fix ci/cd for github #8

Workflow file for this run

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

Check failure on line 28 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI Pipeline

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 28, Col: 12): Job 'test' depends on unknown job '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 }}