xref: /libCEED/.github/workflows/rust-test-with-style.yml (revision 6857ae02ac3824f2069df9eaa9cbf65cdbf9d502)
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:
106c0547c1SJeremy L Thompson        os: [ubuntu-22.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
17ba20f131SJed Brown      uses: actions/checkout@v3
18ded9b81dSJeremy L Thompson    - name: Rust setup
19ba20f131SJed Brown      uses: dtolnay/rust-toolchain@master
20ded9b81dSJeremy L Thompson      with:
21ded9b81dSJeremy L Thompson        # Note: nightly required for coverage of Doctests with tarpaulin
22ded9b81dSJeremy L Thompson        toolchain: nightly
23ded9b81dSJeremy L Thompson    - name: Rust test with coverage
24ded9b81dSJeremy L Thompson      uses: actions-rs/tarpaulin@v0.1
25ded9b81dSJeremy L Thompson      env:
26ded9b81dSJeremy L Thompson        CC: ${{ matrix.compiler }}
276c0547c1SJeremy L Thompson        FC: gfortran-11
28ded9b81dSJeremy L Thompson      with:
2972037c4fSJeremy L Thompson        args: '--run-types Doctests Tests --exclude-files backends/* gallery/* include/* interface/* --out Xml'
30ded9b81dSJeremy L Thompson    - name: Codecov upload
31*6857ae02SJeremy L Thompson      uses: codecov/codecov-action@v3
32ded9b81dSJeremy L Thompson      with:
33c0cd481eSJeremy L Thompson        files: ./cobertura.xml
34ded9b81dSJeremy L Thompson        token: ${{secrets.CODECOV_TOKEN}}
35ded9b81dSJeremy L Thompson
36ded9b81dSJeremy L Thompson  style:
37ded9b81dSJeremy L Thompson    strategy:
38ded9b81dSJeremy L Thompson      matrix:
396c0547c1SJeremy L Thompson        os: [ubuntu-22.04]
40db34a149Sjeremylt        compiler: [clang]
418a4ce0d7SJeremy L Thompson
428a4ce0d7SJeremy L Thompson    runs-on: ${{ matrix.os }}
438a4ce0d7SJeremy L Thompson
448a4ce0d7SJeremy L Thompson    steps:
458a4ce0d7SJeremy L Thompson    - name: Environment setup
46ba20f131SJed Brown      uses: actions/checkout@v3
478a4ce0d7SJeremy L Thompson    - name: Rust setup
48ba20f131SJed Brown      uses: dtolnay/rust-toolchain@master
498a4ce0d7SJeremy L Thompson      with:
502ac872feSjeremylt        # Note: rustfmt not always included in nightly, will attempt to downgrade until rustfmt found
512ac872feSjeremylt        toolchain: nightly
522ac872feSjeremylt        components: rustfmt
538a4ce0d7SJeremy L Thompson    - name: Rust style
548a4ce0d7SJeremy L Thompson      run: |
552ac872feSjeremylt        cargo +nightly fmt --version
562ac872feSjeremylt        cargo +nightly fmt -- --check
57