Skip to content

Commit 0b2ed6c

Browse files
authored
Merge pull request #3 from festim-dev/ci-workflow
Ci workflow
2 parents d0dcdfa + f05b2fb commit 0b2ed6c

8 files changed

Lines changed: 158 additions & 2 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. See error
20+
21+
**Expected behavior**
22+
A clear and concise description of what you expected to happen.
23+
24+
**Screenshots**
25+
If applicable, add screenshots to help explain your problem.

.github/pull_request_template.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Proposed changes
2+
3+
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
4+
5+
## Types of changes
6+
7+
What types of changes does your code introduce to vtk2dolfinx?
8+
<!--Put an `x` in the boxes that apply-->
9+
10+
- [ ] Bugfix (non-breaking change which fixes an issue)
11+
- [ ] New feature (non-breaking change which adds functionality)
12+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
13+
- [ ] Code refactoring
14+
- [ ] Documentation Update (if none of the other choices apply)
15+
- [ ] New tests
16+
17+
## Checklist
18+
19+
<!--Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.-->
20+
21+
- [ ] Unit tests pass locally with my changes
22+
- [ ] I have added tests that prove my fix is effective or that my feature works
23+
- [ ] I have added necessary documentation (if appropriate)
24+
25+
## Further comments
26+
27+
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

.github/workflows/ci_conda.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Conda CI
2+
on: [pull_request, push]
3+
4+
jobs:
5+
run-tests:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
12+
- name: Set up Conda
13+
uses: conda-incubator/setup-miniconda@v3
14+
with:
15+
activate-environment: myenv
16+
miniforge-version: latest
17+
# use-mamba: true
18+
channels: conda-forge
19+
20+
- name: Create Conda environment
21+
shell: bash -l {0}
22+
run: |
23+
conda install -c conda-forge fenics-dolfinx=0.9.0 pyvista
24+
25+
- name: Install local package and dependencies
26+
shell: bash -l {0}
27+
run: |
28+
pip install .[test]
29+
30+
- name: Run tests
31+
shell: bash -l {0}
32+
run: |
33+
pytest test/ --cov vtk2dolfinx --cov-report xml --cov-report term
34+
35+
- name: Upload to codecov
36+
uses: codecov/codecov-action@v5
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
files: ./coverage.xml

.github/workflows/ci_docker.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Docker CI
2+
on: [pull_request, push]
3+
4+
jobs:
5+
run-tests:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
container_version: [v0.9.0, nightly]
11+
container: dolfinx/dolfinx:${{ matrix.container_version }}
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Install local package and dependencies
17+
run: |
18+
pip install .[test]
19+
20+
- name: Run tests
21+
run: |
22+
python3 -m pytest test/ --cov vtk2dolfinx --cov-report xml --cov-report term
23+
24+
- name: Upload to codecov
25+
uses: codecov/codecov-action@v5
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }}
28+
files: ./coverage.xml
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.12"
15+
- name: Install linting tools
16+
run: pip install mypy ruff
17+
18+
- name: ruff format
19+
run: |
20+
ruff format --check .
21+
22+
- name: ruff check
23+
continue-on-error: true
24+
run: |
25+
ruff check .
26+
27+
- name: mypy
28+
continue-on-error: true
29+
run: |
30+
python -m mypy .

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "vtk2dolfinx/_version.py" # ignore version file

src/vtk2dolfinx/vtk_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import dolfinx
22
import pyvista
33

4+
45
class VTKReader:
56
""""""
67

@@ -15,9 +16,8 @@ def __init__(self):
1516
pass
1617

1718

18-
1919
class UnstructuredMeshReader(VTKReader):
2020
""""""
2121

2222
def __init__(self):
23-
pass
23+
pass

test/test_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pytest
2+
3+
4+
def test_example():
5+
pass

0 commit comments

Comments
 (0)