| 1 | name: Rust |
| 2 | |
| 3 | on: |
| 4 | - push |
| 5 | - pull_request |
| 6 | |
| 7 | env: |
| 8 | CARGO_TERM_COLOR: always |
| 9 | |
| 10 | jobs: |
| 11 | format: |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - uses: actions/checkout@v3 |
| 15 | - name: Cargo Fmt |
| 16 | run: cargo fmt --all -- --check |
| 17 | |
| 18 | build: |
| 19 | strategy: |
| 20 | matrix: |
| 21 | os: [ubuntu-latest, windows-latest, macos-latest] |
| 22 | rust: ['stable', '1.74'] |
| 23 | |
| 24 | runs-on: ${{ matrix.os }} |
| 25 | |
| 26 | steps: |
| 27 | - uses: actions/checkout@v3 |
| 28 | - name: Install toolchain |
| 29 | uses: dtolnay/rust-toolchain@stable |
| 30 | with: |
| 31 | toolchain: ${{ matrix.rust }} |
| 32 | override: true |
| 33 | - name: Build |
| 34 | run: cargo build --verbose |
| 35 | - name: Run tests |
| 36 | run: cargo test --verbose |
| 37 | |
| 38 | build_android: |
| 39 | runs-on: ubuntu-latest |
| 40 | steps: |
| 41 | - uses: actions/checkout@v4 |
| 42 | - name: Install toolchain |
| 43 | uses: dtolnay/rust-toolchain@stable |
| 44 | with: |
| 45 | targets: 'aarch64-linux-android, armv7-linux-androideabi' |
| 46 | - name: build |
| 47 | run: | |
| 48 | cargo build --target aarch64-linux-android --all-features |
| 49 | cargo build --target armv7-linux-androideabi --all-features |