Skip to content

Commit fb7e41a

Browse files
committed
[CI] Implementation of of CI pipeline for testing and building
1 parent 7f08675 commit fb7e41a

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/workflows/cibuild.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Building FV2D
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "**" ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
fetch-depth: 0
18+
19+
- name: Install build dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y build-essential cmake python3-venv python3-dev libhdf5-dev pkg-config
23+
24+
- name: Configure and build fv2d
25+
run: |
26+
mkdir -p build
27+
cd build
28+
cmake .. -DCMAKE_BUILD_TYPE=Release
29+
cmake --build . -- -j$(nproc || 2)

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Non-Regression Tests
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "**" ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: 'recursive'
17+
fetch-depth: 0
18+
lfs: true
19+
20+
- name: Install build dependencies
21+
run: |
22+
sudo apt-get update
23+
# Install HDF5 dev packages so CMake/FindHDF5 can locate the libraries and headers
24+
sudo apt-get install -y build-essential cmake python3-venv python3-dev libhdf5-dev pkg-config
25+
26+
- name: Configure and build fv2d
27+
run: |
28+
mkdir -p build
29+
cd build
30+
cmake .. -DCMAKE_BUILD_TYPE=Release
31+
cmake --build . -- -j$(nproc || 2)
32+
33+
- name: Setup Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.10'
37+
38+
- name: Install UV and sync environment
39+
run: |
40+
python -m pip install --upgrade pip
41+
python -m pip install uv
42+
cd tests
43+
uv sync
44+
45+
- name: Run tests with uv (from tests directory)
46+
run: |
47+
cd tests
48+
uv run pytest -v --junitxml=tests.xml
49+
env:
50+
PYTHONPATH: "${{ github.workspace }}"
51+
52+
- name: Upload test results (pytest junit)
53+
if: always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: pytest-report
57+
path: tests/*.xml

0 commit comments

Comments
 (0)