|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + Formatting: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: Install stable toolchain |
| 17 | + uses: actions-rs/toolchain@v1 |
| 18 | + with: |
| 19 | + toolchain: stable |
| 20 | + override: true |
| 21 | + components: rustfmt |
| 22 | + |
| 23 | + - name: Check format |
| 24 | + run: cargo fmt -- --check |
| 25 | + |
| 26 | + Linting: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout repository |
| 30 | + uses: actions/checkout@v2 |
| 31 | + |
| 32 | + - name: Checkout submodules |
| 33 | + uses: textbook/git-checkout-submodule-action@2.0.0 |
| 34 | + |
| 35 | + - name: Install stable toolchain |
| 36 | + uses: actions-rs/toolchain@v1 |
| 37 | + with: |
| 38 | + toolchain: stable |
| 39 | + override: true |
| 40 | + components: clippy |
| 41 | + |
| 42 | + - name: Install system dependencies |
| 43 | + run: | |
| 44 | + sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools |
| 45 | +
|
| 46 | + - name: Lint with clippy |
| 47 | + uses: actions-rs/clippy-check@v1 |
| 48 | + with: |
| 49 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + |
| 51 | + |
| 52 | + Testing: |
| 53 | + needs: Formatting |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Checkout repository |
| 57 | + uses: actions/checkout@v2 |
| 58 | + |
| 59 | + - name: Checkout submodules |
| 60 | + uses: textbook/git-checkout-submodule-action@2.0.0 |
| 61 | + |
| 62 | + - name: Install stable toolchain |
| 63 | + uses: actions-rs/toolchain@v1 |
| 64 | + with: |
| 65 | + toolchain: stable |
| 66 | + override: true |
| 67 | + |
| 68 | + - name: Install system dependencies |
| 69 | + run: | |
| 70 | + sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools |
| 71 | +
|
| 72 | + - name: Run cargo-tarpaulin |
| 73 | + uses: actions-rs/tarpaulin@v0.1 |
| 74 | + with: |
| 75 | + args: '--out Lcov -- --test-threads 1' |
| 76 | + |
| 77 | + - name: Upload coverage |
| 78 | + uses: coverallsapp/github-action@master |
| 79 | + with: |
| 80 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 81 | + path-to-lcov: ./lcov.info |
0 commit comments