xref: /libCEED/.github/workflows/rust-test-with-style.yml (revision 7eaaafceb80f5cb5ccd1fd80420c1c1d8166ddd6)
1name: Rust
2
3on:
4  push:
5
6jobs:
7  test:
8    strategy:
9      matrix:
10        os: [ubuntu-20.04]
11        compiler: [clang]
12
13    runs-on: ${{ matrix.os }}
14
15    steps:
16    - name: Environment setup
17      uses: actions/checkout@v2
18    - name: Rust setup
19      uses: actions-rs/toolchain@v1
20      with:
21        # Note: nightly required for coverage of Doctests with tarpaulin
22        toolchain: nightly
23        override: true
24    - name: Rust test with coverage
25      uses: actions-rs/tarpaulin@v0.1
26      env:
27        CC: ${{ matrix.compiler }}
28        FC: gfortran-9
29      with:
30        version: '0.16.0'
31        args: '--run-types Doctests Tests --exclude-files backends/* gallery/* include/* interface/*'
32    - name: Codecov upload
33      uses: codecov/codecov-action@v1.0.2
34      with:
35        directory: target/tarpaulin
36        token: ${{secrets.CODECOV_TOKEN}}
37
38  style:
39    strategy:
40      matrix:
41        os: [ubuntu-20.04]
42        compiler: [clang]
43
44    runs-on: ${{ matrix.os }}
45
46    steps:
47    - name: Environment setup
48      uses: actions/checkout@v2
49    - name: Rust setup
50      uses: actions-rs/toolchain@v1
51      with:
52        # Note: rustfmt not always included in nightly, will attempt to downgrade until rustfmt found
53        toolchain: nightly
54        components: rustfmt
55    - name: Rust style
56      run: |
57        cargo +nightly fmt --version
58        cargo +nightly fmt -- --check
59