|
| 1 | +name: Continuous Integration Checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches-ignore: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches-ignore: |
| 9 | + - master |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + platform: [ ubuntu-latest, windows-latest, macos-latest ] |
| 21 | + toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV |
| 22 | + exclude: |
| 23 | + - platform: windows-latest |
| 24 | + toolchain: 1.63.0 |
| 25 | + runs-on: ${{ matrix.platform }} |
| 26 | + steps: |
| 27 | + - name: Checkout source code |
| 28 | + uses: actions/checkout@v4 |
| 29 | + - name: Install Rust ${{ matrix.toolchain }} toolchain |
| 30 | + run: | |
| 31 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }} |
| 32 | + rustup override set ${{ matrix.toolchain }} |
| 33 | + - name: shellcheck the CI and `contrib` scripts |
| 34 | + if: "matrix.platform == 'ubuntu-latest'" |
| 35 | + run: | |
| 36 | + sudo apt-get -y install shellcheck |
| 37 | + shellcheck ci/*.sh -aP ci |
| 38 | + - name: Set RUSTFLAGS to deny warnings |
| 39 | + if: "matrix.toolchain == '1.63.0'" |
| 40 | + run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV" |
| 41 | + - name: Run CI script |
| 42 | + shell: bash # Default on Winblows is powershell |
| 43 | + run: ./ci/ci-tests.sh |
| 44 | + |
| 45 | + linting: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + env: |
| 48 | + TOOLCHAIN: stable |
| 49 | + steps: |
| 50 | + - name: Checkout source code |
| 51 | + uses: actions/checkout@v4 |
| 52 | + - name: Install Rust ${{ env.TOOLCHAIN }} toolchain |
| 53 | + run: | |
| 54 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }} |
| 55 | + rustup override set ${{ env.TOOLCHAIN }} |
| 56 | + - name: Install clippy |
| 57 | + run: | |
| 58 | + rustup component add clippy |
| 59 | + - name: Run default clippy linting |
| 60 | + run: | |
| 61 | + ./ci/check-lint.sh |
| 62 | +
|
| 63 | + rustfmt: |
| 64 | + runs-on: ubuntu-latest |
| 65 | + env: |
| 66 | + TOOLCHAIN: 1.63.0 |
| 67 | + steps: |
| 68 | + - name: Checkout source code |
| 69 | + uses: actions/checkout@v4 |
| 70 | + - name: Install Rust ${{ env.TOOLCHAIN }} toolchain |
| 71 | + run: | |
| 72 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }} |
| 73 | + rustup override set ${{ env.TOOLCHAIN }} |
| 74 | + - name: Install rustfmt |
| 75 | + run: | |
| 76 | + rustup component add rustfmt |
| 77 | + - name: Run rustfmt checks |
| 78 | + run: ci/rustfmt.sh |
0 commit comments