xref: /libCEED/.github/workflows/rust-test-with-style.yml (revision dc8efd83546faf0200bf0bfcfb1678fae1874cc5)
1name: Rust
2
3on:
4  push:
5
6jobs:
7  test:
8    strategy:
9      matrix:
10        os: [ubuntu-20.04]
11        compiler: [gcc-10]
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        args: '--run-types Doctests Tests --exclude-files backends/* gallery/* include/* interface/*'
31    - name: Codecov upload
32      uses: codecov/codecov-action@v1.0.2
33      with:
34        directory: target/tarpaulin
35        token: ${{secrets.CODECOV_TOKEN}}
36
37  style:
38    strategy:
39      matrix:
40        os: [ubuntu-20.04]
41        compiler: [gcc-9]
42
43    runs-on: ${{ matrix.os }}
44
45    steps:
46    - name: Environment setup
47      uses: actions/checkout@v2
48    - name: Rust setup
49      uses: actions-rs/toolchain@v1
50      with:
51        # Note: rustfmt not always included in nightly
52        toolchain: stable
53    - name: Rust style
54      run: |
55        cargo fmt -- --check
56