Skip to content

Commit 467b194

Browse files
committed
Add continuous integration and fix errors
1 parent f3f735a commit 467b194

File tree

5 files changed

+99
-3
lines changed

5 files changed

+99
-3
lines changed

.github/workflows/CI.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build-linux:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
rust:
10+
- stable
11+
- nightly
12+
steps:
13+
- run: sudo apt-get update -y
14+
- run: sudo apt-get install -y libmfem-dev
15+
- uses: actions/checkout@v2
16+
- run: |
17+
git submodule init
18+
git submodule update
19+
- run: |
20+
rustup update ${{ matrix.rust }}
21+
rustup default ${{ matrix.rust }}
22+
rustup component add clippy
23+
- run: cargo clippy -p mfem-sys --features bundled -- -D warnings
24+
- run: cargo build -p mfem-sys --features bundled
25+
- run: cargo run -p mfem-sys --features bundled --example ex1 -- --mesh data/square.mesh
26+
27+
build-osx:
28+
runs-on: macos-latest
29+
strategy:
30+
matrix:
31+
rust:
32+
- stable
33+
- nightly
34+
steps:
35+
- run: brew update
36+
- name: Install MPI
37+
run: brew reinstall open-mpi
38+
- run: brew install mfem
39+
- uses: actions/checkout@v2
40+
- run: |
41+
rustup update ${{ matrix.rust }}
42+
rustup default ${{ matrix.rust }}
43+
- run: cargo build -p mfem-sys
44+
- run: cargo run -p mfem-sys --example ex1 -- --mesh data/square.mesh
45+
46+
build-windows:
47+
runs-on: windows-latest
48+
strategy:
49+
matrix:
50+
rust:
51+
- stable
52+
- nightly
53+
steps:
54+
- uses: actions/checkout@v2
55+
- run: |
56+
rustup update ${{ matrix.rust }}
57+
rustup default ${{ matrix.rust }}
58+
- run: cargo build -p mfem-sys --features bundled
59+
- run: cargo run -p mfem-sys --features bundled --example ex1 -- --mesh data/square.mesh
60+
61+
fmt:
62+
name: Rust fmt
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v2
66+
- run: |
67+
rustup update
68+
rustup default stable
69+
rustup component add rustfmt
70+
- run: cargo fmt --all -- --check

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "crates/mfem-cpp/mfem"]
22
path = crates/mfem-cpp/mfem
3-
url = git@github.com:mfem/mfem.git
3+
url = https://github.com/mfem/mfem.git

crates/mfem-sys/MFEM/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ else()
1212
find_package(mfem REQUIRED NAMES MFEM)
1313
endif()
1414

15+
if (NOT DEFINED MFEM_INCLUDE_DIRS)
16+
set(MFEM_INCLUDE_DIRS "")
17+
endif()
18+
1519
file (WRITE ${CMAKE_BINARY_DIR}/mfem_info.txt
1620
"VERSION=${MFEM_VERSION}\n"
1721
"MFEM_LIBRARIES=${MFEM_LIBRARIES}\n"

crates/mfem-sys/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// The list of used MFEM libraries which needs to be linked with.
2-
31
fn main() {
42
let target = std::env::var("TARGET").expect("No TARGET environment variable defined");
53
let is_windows = target.to_lowercase().contains("windows");

data/square.mesh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MFEM mesh v1.0
2+
3+
dimension
4+
2
5+
6+
elements
7+
2
8+
1 2 0 1 2
9+
1 2 0 2 3
10+
11+
boundary
12+
4
13+
1 1 0 1
14+
1 1 1 2
15+
1 1 2 3
16+
1 1 3 0
17+
18+
vertices
19+
4
20+
2
21+
0.0 0.0
22+
1.0 0.0
23+
1.0 1.0
24+
0.0 1.0

0 commit comments

Comments
 (0)