1name: CI 2on: 3 pull_request: 4 push: 5 branches: ["*master"] 6 schedule: 7 - cron: '3 3 3 * *' 8permissions: 9 contents: read 10 11jobs: 12 ci: 13 permissions: 14 contents: none 15 name: CI 16 needs: [test, check, docs, rustfmt, clippy, cffconvert] 17 runs-on: ubuntu-latest 18 steps: 19 - name: Done 20 run: exit 0 21 test: 22 name: Test 23 strategy: 24 matrix: 25 build: [linux, windows, mac, minimal, default, next] 26 include: 27 - build: linux 28 os: ubuntu-latest 29 rust: "stable" 30 features: "full" 31 - build: windows 32 os: windows-latest 33 rust: "stable" 34 features: "full" 35 - build: mac 36 os: macos-latest 37 rust: "stable" 38 features: "full" 39 - build: minimal 40 os: ubuntu-latest 41 rust: "stable" 42 features: "minimal" 43 - build: default 44 os: ubuntu-latest 45 rust: "stable" 46 features: "default" 47 - build: next 48 os: ubuntu-latest 49 rust: "stable" 50 features: "next" 51 continue-on-error: ${{ matrix.rust != 'stable' }} 52 runs-on: ${{ matrix.os }} 53 steps: 54 - name: Checkout repository 55 uses: actions/checkout@v3 56 - name: Install Rust 57 uses: actions-rs/toolchain@v1 58 with: 59 toolchain: ${{ matrix.rust }} 60 profile: minimal 61 override: true 62 - uses: Swatinem/rust-cache@v2 63 - name: Build 64 run: make build-${{matrix.features}} 65 - name: Test 66 run: make test-${{matrix.features}} 67 - name: Test (benches) 68 run: make test-${{matrix.features}} ARGS='--workspace --benches' 69 - name: Test (ultra-minimal) 70 if: matrix.build == 'minimal' 71 run: make test-minimal ARGS='--manifest-path Cargo.toml' 72 check: 73 name: Check 74 runs-on: ubuntu-latest 75 strategy: 76 fail-fast: false 77 matrix: 78 build: [msrv, wasm, wasm-wasi, debug, release] 79 include: 80 - build: msrv 81 rust: 1.64.0 # MSRV 82 target: x86_64-unknown-linux-gnu 83 features: full 84 - build: wasm 85 rust: stable 86 target: wasm32-unknown-unknown 87 features: wasm 88 - build: wasm-wasi 89 rust: stable 90 target: wasm32-wasi 91 features: wasm 92 - build: debug 93 rust: stable 94 target: x86_64-unknown-linux-gnu 95 features: debug 96 - build: release 97 rust: stable 98 target: x86_64-unknown-linux-gnu 99 features: release 100 steps: 101 - name: Checkout repository 102 uses: actions/checkout@v3 103 - name: Install rust 104 uses: actions-rs/toolchain@v1 105 with: 106 toolchain: ${{ matrix.rust }} 107 target: ${{ matrix.target }} 108 override: true 109 - uses: Swatinem/rust-cache@v2 110 - name: Check 111 run: make check-${{ matrix.features }} 112 env: 113 TOOLCHAIN_TARGET: ${{ matrix.target }} 114 ui: 115 name: UI Tests 116 runs-on: ubuntu-latest 117 strategy: 118 fail-fast: false 119 matrix: 120 features: [default, next] 121 steps: 122 - name: Checkout repository 123 uses: actions/checkout@v3 124 - name: Install Rust 125 uses: actions-rs/toolchain@v1 126 with: 127 toolchain: 1.64.0 # MSRV 128 profile: minimal 129 override: true 130 - uses: Swatinem/rust-cache@v2 131 - name: UI Tests 132 run: make test-ui-${{ matrix.features }} 133 docs: 134 name: Docs 135 runs-on: ubuntu-latest 136 steps: 137 - name: Checkout repository 138 uses: actions/checkout@v3 139 - name: Install Rust 140 uses: actions-rs/toolchain@v1 141 with: 142 toolchain: 1.64.0 # MSRV 143 profile: minimal 144 override: true 145 - uses: Swatinem/rust-cache@v2 146 - name: Check documentation 147 env: 148 RUSTDOCFLAGS: -D warnings 149 run: make doc 150 rustfmt: 151 name: rustfmt 152 runs-on: ubuntu-latest 153 steps: 154 - name: Checkout repository 155 uses: actions/checkout@v3 156 - name: Install Rust 157 uses: actions-rs/toolchain@v1 158 with: 159 # Not MSRV because its harder to jump between versions and people are 160 # more likely to have stable 161 toolchain: stable 162 profile: minimal 163 override: true 164 components: rustfmt 165 - uses: Swatinem/rust-cache@v2 166 - name: Check formatting 167 run: cargo fmt --all -- --check 168 clippy: 169 name: clippy 170 runs-on: ubuntu-latest 171 steps: 172 - name: Checkout repository 173 uses: actions/checkout@v3 174 - name: Install Rust 175 uses: actions-rs/toolchain@v1 176 with: 177 toolchain: 1.64.0 # MSRV 178 profile: minimal 179 override: true 180 components: clippy 181 - uses: Swatinem/rust-cache@v2 182 - name: Lint (ultra-minimal) 183 run: make clippy-minimal ARGS='--manifest-path Cargo.toml' 184 - name: Lint (minimal) 185 run: make clippy-minimal 186 - name: Lint (all) 187 run: make clippy-full 188 - name: Lint (release) 189 run: make clippy-release 190 cffconvert: 191 name: cffconvert 192 runs-on: ubuntu-latest 193 steps: 194 - name: Checkout repository 195 uses: actions/checkout@v3 196 with: 197 persist-credentials: false 198 - name: CFF validation 199 uses: citation-file-format/cffconvert-github-action@2.0.0 200 with: 201 args: --validate 202