Skip to content

Commit

Permalink
ENH: Add GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit9126 committed Nov 26, 2024
1 parent 9baa52a commit bf34b75
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "monthly"
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches: [main, develop]
tags:
- "*"
paths-ignore:
- "doc/**"
- ".vscode/**"
pull_request:
branches: [main, develop]
paths-ignore:
- "doc/**"
- ".vscode/**"

env:
CI: true
UV_SYSTEM_PYTHON: 1

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
with:
lfs: false

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Cache git LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: git-lfs-v1-${{ matrix.python-version }}-${{ hashFiles('.lfs-assets-id') }}
restore-keys: |
git-lfs-v1-${{ matrix.python-version }}
git-lfs-v1
git-lfs
- name: Git LFS
run: |
git lfs checkout
git lfs pull
git lfs prune --verify-remote
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
uv sync --frozen --all-extras
- name: Test with pytest
run: |
uv run pytest -vv -n=auto --durations=25 --cov-report html --cov-config pyproject.toml roseau
env:
ROSEAU_LOAD_FLOW_LICENSE_KEY: ${{ secrets.ROSEAU_LOAD_FLOW_LICENSE_KEY }}

- name: Archive code coverage results
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ runner.os }}-python-${{ matrix.python-version }}
path: htmlcov/
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pre-commit

on:
push:
branches: [main, develop]
paths-ignore:
- ".vscode/**"
- ".idea/**"
tags:
- "*"
pull_request:
branches: [main, develop]
paths-ignore:
- ".vscode/**"
- ".idea/**"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: false
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: pre-commit/[email protected]

0 comments on commit bf34b75

Please sign in to comment.