add Makefile with standard targets #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: make check-format | |
| check: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| toolchain: [stable, beta] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install GNU sed (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install gnu-sed | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check compilation | |
| run: make check | |
| - name: Lint | |
| run: make lint | |
| - name: Test | |
| run: make test | |
| check-trailing-whitespace: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check trailing whitespace | |
| run: make check-trailing-whitespace |