Skip to content

Add repository infrastructure: Dependabot, issue/PR templates, CODEOWNERS, and configuration fixes #281

Add repository infrastructure: Dependabot, issue/PR templates, CODEOWNERS, and configuration fixes

Add repository infrastructure: Dependabot, issue/PR templates, CODEOWNERS, and configuration fixes #281

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov black flake8 mypy
pip install -e ".[compiler]"
- name: Run black formatter check
run: |
black --check src/ tests/
- name: Run flake8
run: |
flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Run tests with coverage
run: |
python -m pytest tests/ -v --cov=eigenscript --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Test example programs
run: |
python -m eigenscript examples/hello_world.eigs
python -m eigenscript examples/factorial.eigs
python -m eigenscript examples/core_operators.eigs
type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install mypy types-setuptools
pip install -e ".[compiler]"
- name: Run mypy
continue-on-error: true
run: |
mypy src/eigenscript --ignore-missing-imports
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install safety bandit
- name: Run safety check
continue-on-error: true
run: |
safety check
- name: Run bandit security scan
continue-on-error: true
run: |
bandit -r src/eigenscript -ll