|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['main'] |
| 6 | + pull_request: |
| 7 | + schedule: |
| 8 | + - cron: "21 3 * * 5" |
| 9 | + |
| 10 | +jobs: |
| 11 | + test-freebsd: |
| 12 | + # see https://github.com/actions/runner/issues/385 |
| 13 | + # use https://github.com/vmactions/freebsd-vm for now |
| 14 | + name: test on freebsd |
| 15 | + runs-on: macos-12 |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - name: test on freebsd |
| 19 | + uses: vmactions/freebsd-vm@v0 |
| 20 | + with: |
| 21 | + usesh: true |
| 22 | + mem: 4096 |
| 23 | + copyback: false |
| 24 | + prepare: | |
| 25 | + pkg install -y curl |
| 26 | + curl https://sh.rustup.rs -sSf --output rustup.sh |
| 27 | + sh rustup.sh -y --profile minimal --default-toolchain stable |
| 28 | + echo "~~~~ rustc --version ~~~~" |
| 29 | + $HOME/.cargo/bin/rustc --version |
| 30 | + run: | |
| 31 | + freebsd-version |
| 32 | + $HOME/.cargo/bin/cargo build --all-targets |
| 33 | + $HOME/.cargo/bin/cargo test |
| 34 | + test: |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 38 | + rust: [stable, beta, 1.59.0] |
| 39 | + exclude: |
| 40 | + - os: macos-latest |
| 41 | + rust: beta |
| 42 | + - os: macos-latest |
| 43 | + rust: 1.59.0 |
| 44 | + - os: windows-latest |
| 45 | + rust: beta |
| 46 | + - os: windows-latest |
| 47 | + rust: 1.59.0 |
| 48 | + |
| 49 | + runs-on: ${{ matrix.os }} |
| 50 | + |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - uses: actions-rs/toolchain@v1 |
| 54 | + with: |
| 55 | + profile: minimal |
| 56 | + toolchain: ${{ matrix.rust }} |
| 57 | + override: true |
| 58 | + - uses: Swatinem/rust-cache@v1 |
| 59 | + - uses: actions-rs/cargo@v1 |
| 60 | + with: |
| 61 | + command: build |
| 62 | + args: --all-targets |
| 63 | + - uses: actions-rs/cargo@v1 |
| 64 | + with: |
| 65 | + command: test |
| 66 | + |
| 67 | + lint: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v2 |
| 71 | + - uses: actions-rs/toolchain@v1 |
| 72 | + with: |
| 73 | + profile: minimal |
| 74 | + toolchain: stable |
| 75 | + override: true |
| 76 | + components: rustfmt, clippy |
| 77 | + - uses: Swatinem/rust-cache@v1 |
| 78 | + - uses: actions-rs/cargo@v1 |
| 79 | + with: |
| 80 | + command: fmt |
| 81 | + args: --all -- --check |
| 82 | + - uses: actions-rs/cargo@v1 |
| 83 | + with: |
| 84 | + command: clippy |
| 85 | + args: --all-targets -- -D warnings |
| 86 | + - uses: actions-rs/toolchain@v1 |
| 87 | + with: |
| 88 | + profile: minimal |
| 89 | + toolchain: stable |
| 90 | + override: true |
| 91 | + components: clippy |
| 92 | + - name: doc |
| 93 | + run: cargo doc --no-deps --document-private-items |
| 94 | + env: |
| 95 | + RUSTDOCFLAGS: -Dwarnings |
| 96 | + |
| 97 | + audit: |
| 98 | + runs-on: ubuntu-latest |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v2 |
| 101 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
0 commit comments