mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
* Migrate Specta to Tsify to auto-generate messages.ts, working except colors and widgets * Adopt the generated FillColor/Color/GradientStops * Fix widget typing * Separate WidgetGroup enum variants into wrapper structs * Small rename * Simplify widgets further * Clean up message type references * Switch type imports to the auto-generated file * Remove lowercase serde rename * Fix FillChoice deserialization * Fix small regression from #3837 * Improve type safety * Make WidgetSpan type-safe * More cleanup and type safety * More type safety * More type safety * Get the rest to type-check without errors; improve widget builder macro to have optional icons; improve Svelte 5 configs * Cargo fmt * Fix imports * Update outdated readme info * Fix lint command rename references * Fix typos * One more typos fix * Remove unnecessary dep: prefix from the edited Cargo.toml files * Remove excess parts from Cargo.toml * Fix compiling on desktop * Revert "Remove excess parts from Cargo.toml" This reverts commit 6b711117b3a5d5d8a3ee20f36a43bc74930b7c82. * Update dev docs with simpler, more accurate instructions
154 lines
4.4 KiB
YAML
154 lines
4.4 KiB
YAML
name: "CI"
|
|
|
|
on:
|
|
pull_request: {}
|
|
merge_group: {}
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
# Rust format check on GitHub runner
|
|
rust-fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 📥 Clone and checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🚦 Check if CI can be skipped
|
|
id: skip-check
|
|
uses: cariad-tech/merge-queue-ci-skipper@main
|
|
|
|
- name: 🦀 Install the latest Rust
|
|
if: steps.skip-check.outputs.skip-check != 'true'
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
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
|
|
cargo-deny:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 📥 Clone and checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- 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
|
|
|
|
# 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 and checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- 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 the latest Node.js
|
|
if: steps.skip-check.outputs.skip-check != 'true'
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "latest"
|
|
|
|
- name: 🚧 Install build dependencies
|
|
if: steps.skip-check.outputs.skip-check != 'true'
|
|
run: |
|
|
cd frontend
|
|
npm run setup
|
|
|
|
- name: 🦀 Install the latest Rust
|
|
if: steps.skip-check.outputs.skip-check != 'true'
|
|
run: |
|
|
rustup update stable
|
|
|
|
- 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'
|
|
uses: cloudflare/pages-action@1
|
|
continue-on-error: true
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
projectName: graphite-dev
|
|
directory: frontend/dist
|
|
|
|
- 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 and checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 🚦 Check if CI can be skipped
|
|
id: skip-check
|
|
uses: cariad-tech/merge-queue-ci-skipper@main
|
|
|
|
- name: 🦀 Install the latest Rust
|
|
if: steps.skip-check.outputs.skip-check != 'true'
|
|
run: |
|
|
rustup update stable
|
|
|
|
- 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
|