xref: /libCEED/.github/workflows/rust-test-with-style.yml (revision 2ac872fe09e35217845f7cccbe5121b5cf6a6a3d)
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:
10b0ae8d51SJed Brown        os: [ubuntu-20.04]
11db34a149Sjeremylt        compiler: [clang]
12ded9b81dSJeremy L Thompson
13ded9b81dSJeremy L Thompson    runs-on: ${{ matrix.os }}
14ded9b81dSJeremy L Thompson
15ded9b81dSJeremy L Thompson    steps:
16ded9b81dSJeremy L Thompson    - name: Environment setup
17ded9b81dSJeremy L Thompson      uses: actions/checkout@v2
18ded9b81dSJeremy L Thompson    - name: Rust setup
19ded9b81dSJeremy L Thompson      uses: actions-rs/toolchain@v1
20ded9b81dSJeremy L Thompson      with:
21ded9b81dSJeremy L Thompson        # Note: nightly required for coverage of Doctests with tarpaulin
22ded9b81dSJeremy L Thompson        toolchain: nightly
23ded9b81dSJeremy L Thompson        override: true
24ded9b81dSJeremy L Thompson    - name: Rust test with coverage
25ded9b81dSJeremy L Thompson      uses: actions-rs/tarpaulin@v0.1
26ded9b81dSJeremy L Thompson      env:
27ded9b81dSJeremy L Thompson        CC: ${{ matrix.compiler }}
28ded9b81dSJeremy L Thompson        FC: gfortran-9
29ded9b81dSJeremy L Thompson      with:
30ded9b81dSJeremy L Thompson        args: '--run-types Doctests Tests --exclude-files backends/* gallery/* include/* interface/*'
31ded9b81dSJeremy L Thompson    - name: Codecov upload
32ded9b81dSJeremy L Thompson      uses: codecov/codecov-action@v1.0.2
33ded9b81dSJeremy L Thompson      with:
34ded9b81dSJeremy L Thompson        directory: target/tarpaulin
35ded9b81dSJeremy L Thompson        token: ${{secrets.CODECOV_TOKEN}}
36ded9b81dSJeremy L Thompson
37ded9b81dSJeremy L Thompson  style:
38ded9b81dSJeremy L Thompson    strategy:
39ded9b81dSJeremy L Thompson      matrix:
40ded9b81dSJeremy L Thompson        os: [ubuntu-20.04]
41db34a149Sjeremylt        compiler: [clang]
428a4ce0d7SJeremy L Thompson
438a4ce0d7SJeremy L Thompson    runs-on: ${{ matrix.os }}
448a4ce0d7SJeremy L Thompson
458a4ce0d7SJeremy L Thompson    steps:
468a4ce0d7SJeremy L Thompson    - name: Environment setup
478a4ce0d7SJeremy L Thompson      uses: actions/checkout@v2
488a4ce0d7SJeremy L Thompson    - name: Rust setup
498a4ce0d7SJeremy L Thompson      uses: actions-rs/toolchain@v1
508a4ce0d7SJeremy L Thompson      with:
51*2ac872feSjeremylt        # Note: rustfmt not always included in nightly, will attempt to downgrade until rustfmt found
52*2ac872feSjeremylt        toolchain: nightly
53*2ac872feSjeremylt        components: rustfmt
548a4ce0d7SJeremy L Thompson    - name: Rust style
558a4ce0d7SJeremy L Thompson      run: |
56*2ac872feSjeremylt        cargo +nightly fmt --version
57*2ac872feSjeremylt        cargo +nightly fmt -- --check
58