name: "CI" on: pull_request: {} merge_group: {} env: CARGO_TERM_COLOR: always jobs: # Build the web app on the self-hosted wasm runner build: runs-on: [self-hosted, target/wasm] permissions: contents: write deployments: write pull-requests: write actions: write env: RUSTC_WRAPPER: /usr/bin/sccache CARGO_INCREMENTAL: 0 SCCACHE_DIR: /var/lib/github-actions/.cache steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v6 - name: ๐Ÿšฆ Check if CI can be skipped id: skip-check uses: cariad-tech/merge-queue-ci-skipper@main - name: ๐Ÿ—‘ Clear wasm-bindgen cache if: steps.skip-check.outputs.skip-check != 'true' run: rm -r ~/.cache/.wasm-pack || true - name: ๐ŸŸข Install Node.js if: steps.skip-check.outputs.skip-check != 'true' uses: actions/setup-node@v6 with: node-version-file: .nvmrc - name: ๐Ÿšง Install build dependencies if: steps.skip-check.outputs.skip-check != 'true' run: | cd frontend npm run setup - name: ๐Ÿฆ€ Install Rust if: steps.skip-check.outputs.skip-check != 'true' uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable override: true cache: false rustflags: "" target: wasm32-unknown-unknown - name: ๐Ÿฆ€ Fetch Rust dependencies if: steps.skip-check.outputs.skip-check != 'true' run: | cargo fetch --locked - name: ๐ŸŒ Build Graphite web code if: steps.skip-check.outputs.skip-check != 'true' env: NODE_ENV: production run: mold -run cargo run build web - name: ๐Ÿ“ค Publish to Cloudflare Pages if: steps.skip-check.outputs.skip-check != 'true' continue-on-error: true env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-dev" --commit-dirty=true - name: ๐Ÿ‘• Lint Graphite web formatting if: steps.skip-check.outputs.skip-check != 'true' env: NODE_ENV: production run: | cd frontend npm run check # Run the Rust tests on the self-hosted native runner test: runs-on: [self-hosted, target/native] env: RUSTC_WRAPPER: /usr/bin/sccache CARGO_INCREMENTAL: 0 SCCACHE_DIR: /var/lib/github-actions/.cache steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v6 - name: ๐Ÿšฆ Check if CI can be skipped id: skip-check uses: cariad-tech/merge-queue-ci-skipper@main - name: ๐Ÿฆ€ Install Rust if: steps.skip-check.outputs.skip-check != 'true' uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable override: true cache: false rustflags: "" - name: ๐Ÿฆ€ Fetch Rust dependencies if: steps.skip-check.outputs.skip-check != 'true' run: | cargo fetch --locked - name: ๐Ÿงช Run Rust tests if: steps.skip-check.outputs.skip-check != 'true' env: RUSTFLAGS: -Dwarnings run: | mold -run cargo test --all-features # Rust format check on GitHub runner rust-fmt: runs-on: ubuntu-latest steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v6 - name: ๐Ÿšฆ Check if CI can be skipped id: skip-check uses: cariad-tech/merge-queue-ci-skipper@main - name: ๐Ÿฆ€ Install Rust if: steps.skip-check.outputs.skip-check != 'true' uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable override: true cache: false rustflags: "" components: rustfmt - name: ๐Ÿ”ฌ Check Rust formatting if: steps.skip-check.outputs.skip-check != 'true' run: cargo fmt --all -- --check # License compatibility check on GitHub runner check-licenses: runs-on: ubuntu-latest steps: - name: ๐Ÿ“ฅ Clone repository uses: actions/checkout@v6 - name: ๐Ÿ“œ Check crate license compatibility for root workspace uses: EmbarkStudios/cargo-deny-action@v2 with: command: check bans licenses sources - name: ๐Ÿ“œ Check crate license compatibility for /libraries/rawkit uses: EmbarkStudios/cargo-deny-action@v2 with: command: check bans licenses sources manifest-path: libraries/rawkit/Cargo.toml