|
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
| 5 | +<<<<<<< HEAD |
5 | 6 | branches: [ main ] |
6 | 7 | pull_request: |
7 | 8 | branches: [ main ] |
@@ -91,3 +92,207 @@ jobs: |
91 | 92 | |
92 | 93 | - name: Build (excluding examples) |
93 | 94 | run: cargo build --workspace --exclude examples --release |
| 95 | +||||||| parent of f0948e7 ([SDK] Introduce a replacement Rust SDK for the entirety of the existing one) |
| 96 | +======= |
| 97 | + branches: [main, develop] |
| 98 | + pull_request: |
| 99 | + branches: [main, develop] |
| 100 | + |
| 101 | +env: |
| 102 | + CARGO_TERM_COLOR: always |
| 103 | + RUST_BACKTRACE: 1 |
| 104 | + |
| 105 | +jobs: |
| 106 | + format: |
| 107 | + name: Format |
| 108 | + runs-on: ubuntu-latest |
| 109 | + steps: |
| 110 | + - uses: actions/checkout@v4 |
| 111 | + |
| 112 | + - name: Install Rust nightly |
| 113 | + uses: dtolnay/rust-toolchain@nightly |
| 114 | + with: |
| 115 | + components: rustfmt |
| 116 | + |
| 117 | + - name: Check formatting |
| 118 | + run: cargo +nightly fmt --all -- --check |
| 119 | + |
| 120 | + lint: |
| 121 | + name: Lint |
| 122 | + runs-on: ubuntu-latest |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v4 |
| 125 | + |
| 126 | + - name: Install Rust |
| 127 | + uses: dtolnay/rust-toolchain@stable |
| 128 | + with: |
| 129 | + components: clippy |
| 130 | + |
| 131 | + - name: Cache cargo |
| 132 | + uses: Swatinem/rust-cache@v2 |
| 133 | + |
| 134 | + - name: Run Clippy (default features) |
| 135 | + run: cargo clippy --all-targets -- -D warnings |
| 136 | + |
| 137 | + - name: Run Clippy (all features) |
| 138 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 139 | + |
| 140 | + - name: Run Clippy (no default features) |
| 141 | + run: cargo clippy -p aptos-rust-sdk-v2 --no-default-features -- -D warnings |
| 142 | + |
| 143 | + test: |
| 144 | + name: Test |
| 145 | + runs-on: ${{ matrix.os }} |
| 146 | + strategy: |
| 147 | + fail-fast: false |
| 148 | + matrix: |
| 149 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 150 | + rust: [stable, beta] |
| 151 | + steps: |
| 152 | + - uses: actions/checkout@v4 |
| 153 | + |
| 154 | + - name: Install Rust ${{ matrix.rust }} |
| 155 | + uses: dtolnay/rust-toolchain@master |
| 156 | + with: |
| 157 | + toolchain: ${{ matrix.rust }} |
| 158 | + |
| 159 | + - name: Cache cargo |
| 160 | + uses: Swatinem/rust-cache@v2 |
| 161 | + |
| 162 | + - name: Build |
| 163 | + run: cargo build --all-targets |
| 164 | + |
| 165 | + - name: Run tests |
| 166 | + run: cargo test --all-targets |
| 167 | + |
| 168 | + - name: Run tests (all features) |
| 169 | + run: cargo test --all-targets --all-features |
| 170 | + |
| 171 | + test-features: |
| 172 | + name: Test Feature Combinations |
| 173 | + runs-on: ubuntu-latest |
| 174 | + steps: |
| 175 | + - uses: actions/checkout@v4 |
| 176 | + |
| 177 | + - name: Install Rust |
| 178 | + uses: dtolnay/rust-toolchain@stable |
| 179 | + |
| 180 | + - name: Cache cargo |
| 181 | + uses: Swatinem/rust-cache@v2 |
| 182 | + |
| 183 | + - name: Test with only ed25519 |
| 184 | + run: cargo test -p aptos-rust-sdk-v2 --no-default-features --features ed25519 |
| 185 | + |
| 186 | + - name: Test with only secp256k1 |
| 187 | + run: cargo test -p aptos-rust-sdk-v2 --no-default-features --features secp256k1 |
| 188 | + |
| 189 | + - name: Test with secp256r1 |
| 190 | + run: cargo test -p aptos-rust-sdk-v2 --features secp256r1 |
| 191 | + |
| 192 | + - name: Test with bls |
| 193 | + run: cargo test -p aptos-rust-sdk-v2 --features bls |
| 194 | + |
| 195 | + - name: Test with faucet |
| 196 | + run: cargo test -p aptos-rust-sdk-v2 --features faucet |
| 197 | + |
| 198 | + - name: Test with indexer |
| 199 | + run: cargo test -p aptos-rust-sdk-v2 --features indexer |
| 200 | + |
| 201 | + - name: Test with full features |
| 202 | + run: cargo test -p aptos-rust-sdk-v2 --features full |
| 203 | + |
| 204 | + docs: |
| 205 | + name: Documentation |
| 206 | + runs-on: ubuntu-latest |
| 207 | + steps: |
| 208 | + - uses: actions/checkout@v4 |
| 209 | + |
| 210 | + - name: Install Rust |
| 211 | + uses: dtolnay/rust-toolchain@stable |
| 212 | + |
| 213 | + - name: Cache cargo |
| 214 | + uses: Swatinem/rust-cache@v2 |
| 215 | + |
| 216 | + - name: Check documentation |
| 217 | + env: |
| 218 | + RUSTDOCFLAGS: -D warnings |
| 219 | + run: cargo doc --no-deps --all-features |
| 220 | + |
| 221 | + - name: Check examples documentation |
| 222 | + env: |
| 223 | + RUSTDOCFLAGS: -D warnings |
| 224 | + run: cargo doc -p aptos-rust-sdk-v2 --all-features --document-private-items |
| 225 | + |
| 226 | + # Deploy docs to GitHub Pages on main branch |
| 227 | + deploy-docs: |
| 228 | + name: Deploy Documentation |
| 229 | + runs-on: ubuntu-latest |
| 230 | + needs: [docs, test, lint] |
| 231 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 232 | + permissions: |
| 233 | + contents: read |
| 234 | + pages: write |
| 235 | + id-token: write |
| 236 | + environment: |
| 237 | + name: github-pages |
| 238 | + url: ${{ steps.deployment.outputs.page_url }} |
| 239 | + steps: |
| 240 | + - uses: actions/checkout@v4 |
| 241 | + |
| 242 | + - name: Install Rust |
| 243 | + uses: dtolnay/rust-toolchain@stable |
| 244 | + |
| 245 | + - name: Cache cargo |
| 246 | + uses: Swatinem/rust-cache@v2 |
| 247 | + |
| 248 | + - name: Build documentation |
| 249 | + env: |
| 250 | + RUSTDOCFLAGS: --cfg docsrs |
| 251 | + run: cargo doc --no-deps --all-features |
| 252 | + |
| 253 | + - name: Add redirect to main crate |
| 254 | + run: | |
| 255 | + echo '<meta http-equiv="refresh" content="0; url=aptos_rust_sdk_v2/index.html">' > target/doc/index.html |
| 256 | + |
| 257 | + - name: Setup Pages |
| 258 | + uses: actions/configure-pages@v4 |
| 259 | + |
| 260 | + - name: Upload artifact |
| 261 | + uses: actions/upload-pages-artifact@v3 |
| 262 | + with: |
| 263 | + path: target/doc |
| 264 | + |
| 265 | + - name: Deploy to GitHub Pages |
| 266 | + id: deployment |
| 267 | + uses: actions/deploy-pages@v4 |
| 268 | + |
| 269 | + msrv: |
| 270 | + name: Minimum Supported Rust Version |
| 271 | + runs-on: ubuntu-latest |
| 272 | + steps: |
| 273 | + - uses: actions/checkout@v4 |
| 274 | + |
| 275 | + - name: Install Rust 1.90 |
| 276 | + uses: dtolnay/rust-toolchain@master |
| 277 | + with: |
| 278 | + toolchain: "1.90" |
| 279 | + |
| 280 | + - name: Cache cargo |
| 281 | + uses: Swatinem/rust-cache@v2 |
| 282 | + |
| 283 | + - name: Check MSRV |
| 284 | + run: cargo check -p aptos-rust-sdk-v2 |
| 285 | + |
| 286 | + security-audit: |
| 287 | + name: Security Audit |
| 288 | + runs-on: ubuntu-latest |
| 289 | + steps: |
| 290 | + - uses: actions/checkout@v4 |
| 291 | + |
| 292 | + - name: Install cargo-audit |
| 293 | + run: cargo install cargo-audit |
| 294 | + |
| 295 | + - name: Run security audit |
| 296 | + run: cargo audit |
| 297 | + |
| 298 | +>>>>>>> f0948e7 ([SDK] Introduce a replacement Rust SDK for the entirety of the existing one) |
0 commit comments