|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_TERM_COLOR: always |
| 13 | + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
| 14 | + CARGO_NET_GIT_FETCH_WITH_CLI: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + ci: |
| 18 | + name: Format, lint, build, and test |
| 19 | + runs-on: spiceai-macos |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Check out repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Set up Rust toolchain |
| 28 | + uses: dtolnay/rust-toolchain@stable |
| 29 | + with: |
| 30 | + components: rustfmt,clippy |
| 31 | + |
| 32 | + - name: Cache Rust build artifacts |
| 33 | + uses: Swatinem/rust-cache@v2 |
| 34 | + |
| 35 | + - name: Check formatting |
| 36 | + run: cargo fmt --all --check |
| 37 | + |
| 38 | + - name: Run cargo check |
| 39 | + run: cargo check --locked --all-targets --all-features |
| 40 | + |
| 41 | + - name: Run clippy |
| 42 | + run: cargo clippy --locked --all-targets --all-features -- -D warnings -D clippy::all -D clippy::cargo -A clippy::cargo-common-metadata |
| 43 | + |
| 44 | + - name: Check rustdoc |
| 45 | + run: RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --no-deps --document-private-items |
| 46 | + |
| 47 | + - name: Build debug binary |
| 48 | + run: cargo build --locked |
| 49 | + |
| 50 | + - name: Run unit tests |
| 51 | + run: cargo test --locked |
| 52 | + |
| 53 | + - name: Run sccache integration test |
| 54 | + env: |
| 55 | + SPICEIO_SMB_SERVER: 192.168.3.148 |
| 56 | + SPICEIO_SMB_USER: runner |
| 57 | + SPICEIO_SMB_PASS: ${{ secrets.UNAS_SMB_PASS }} |
| 58 | + SPICEIO_SMB_SHARE: ai_platform_dev |
| 59 | + SPICEIO_BUCKET: spiceio |
| 60 | + SPICEIO_REGION: us-west-1 |
| 61 | + run: ./scripts/test-sccache.sh |
| 62 | + |
| 63 | + - name: Build release artifact |
| 64 | + run: cargo build --release --locked --bin spiceio |
| 65 | + |
| 66 | + - name: Upload release artifact |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: spiceio-${{ runner.os }}-${{ runner.arch }} |
| 70 | + path: target/release/spiceio |
| 71 | + if-no-files-found: error |
0 commit comments