use code editor in demo site #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**" | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - main | |
| paths: | |
| - "**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| if: github.event.pull_request.draft == false | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev | |
| version: 1.0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| cache-on-failure: "false" | |
| - name: Check | |
| run: cargo check --workspace --all-features | |
| test: | |
| if: github.event.pull_request.draft == false | |
| name: Test Suite | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free Disk Space | |
| uses: ./.github/actions/free-disk-space | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev | |
| version: 1.0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - uses: browser-actions/setup-firefox@latest | |
| - name: Test | |
| run: cargo test --workspace | |
| fmt: | |
| if: github.event.pull_request.draft == false | |
| name: Rustfmt | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - name: Format | |
| run: cargo fmt --all -- --check | |
| docs: | |
| if: github.event.pull_request.draft == false | |
| name: Docs | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev | |
| version: 1.0 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - name: Docs | |
| run: cargo doc --workspace --no-deps --all-features --document-private-items | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings --document-private-items | |
| clippy: | |
| if: github.event.pull_request.draft == false | |
| name: Clippy | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev | |
| version: 1.0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - name: Clippy | |
| run: cargo clippy --workspace --examples --tests --all-features --all-targets -- -D warnings | |
| web-demo: | |
| if: github.event.pull_request.draft == false | |
| name: Web Demo | |
| runs-on: ubuntu-latest | |
| env: | |
| CARGO_INCREMENTAL: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev | |
| version: 1.0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| cache-on-failure: "false" | |
| cache-directories: "target/dx" | |
| - uses: cargo-bins/cargo-binstall@main | |
| - name: Install Dioxus CLI | |
| run: cargo binstall dioxus-cli -y --force --version 0.7.7 | |
| - name: Build web demo | |
| run: cd demo && dx build --web --release --no-default-features --features web --debug-symbols false --base-path "${{ github.event.repository.name }}" |