xref: /libCEED/.github/workflows/rust-test-with-style.yml (revision b0ae8d517c946075df97529a50d1cf3d819480eb)
18a4ce0d7SJeremy L Thompsonname: Rust
28a4ce0d7SJeremy L Thompson
38a4ce0d7SJeremy L Thompsonon:
48a4ce0d7SJeremy L Thompson  push:
58a4ce0d7SJeremy L Thompson
68a4ce0d7SJeremy L Thompsonjobs:
78a4ce0d7SJeremy L Thompson  test:
88a4ce0d7SJeremy L Thompson    strategy:
98a4ce0d7SJeremy L Thompson      matrix:
10*b0ae8d51SJed Brown        os: [ubuntu-20.04]
118a4ce0d7SJeremy L Thompson        compiler: [gcc-9]
128a4ce0d7SJeremy L Thompson
138a4ce0d7SJeremy L Thompson    runs-on: ${{ matrix.os }}
148a4ce0d7SJeremy L Thompson
158a4ce0d7SJeremy L Thompson    steps:
168a4ce0d7SJeremy L Thompson    - name: Environment setup
178a4ce0d7SJeremy L Thompson      uses: actions/checkout@v2
188a4ce0d7SJeremy L Thompson    - name: Rust setup
198a4ce0d7SJeremy L Thompson      uses: actions-rs/toolchain@v1
208a4ce0d7SJeremy L Thompson      with:
218a4ce0d7SJeremy L Thompson        toolchain: stable
228a4ce0d7SJeremy L Thompson    - name: Rust test
238a4ce0d7SJeremy L Thompson      env:
248a4ce0d7SJeremy L Thompson        CC: ${{ matrix.compiler }}
258a4ce0d7SJeremy L Thompson        FC: gfortran-9
268a4ce0d7SJeremy L Thompson      run: |
278a4ce0d7SJeremy L Thompson        make info
288a4ce0d7SJeremy L Thompson        make -j2
298a4ce0d7SJeremy L Thompson        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
308a4ce0d7SJeremy L Thompson        cd rust && cargo build
318a4ce0d7SJeremy L Thompson        cargo test
328a4ce0d7SJeremy L Thompson        cd ..
338a4ce0d7SJeremy L Thompson    - name: Rust style
348a4ce0d7SJeremy L Thompson      run: |
358a4ce0d7SJeremy L Thompson        cd rust && cargo fmt -- --check
36