fix(docs): guard stale preview deployments (#159) #438
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: ["**"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| jobs: | |
| rust-lint: | |
| name: Rust Linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy, rustfmt | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| cache-workspace-crates: true | |
| cache-on-failure: true | |
| - name: Format Check | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| rust-test: | |
| name: Rust Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| cache-workspace-crates: true | |
| cache-on-failure: true | |
| - name: Test | |
| run: rustup run nightly cargo test --workspace | |
| vscode-extension: | |
| name: VS Code Checks | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: editors/vscode | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| cache-workspace-crates: true | |
| cache-on-failure: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test extension | |
| run: npm test | |
| dev-package: | |
| name: Dev Package (${{ matrix.target }}) | |
| if: github.event_name != 'pull_request' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Keep the Linux x64 VSIX compatible with Ubuntu 22.04 glibc/libstdc++. | |
| - os: ubuntu-22.04 | |
| target: linux-x64 | |
| - os: ubuntu-24.04-arm | |
| target: linux-arm64 | |
| - os: windows-latest | |
| target: win32-x64 | |
| - os: macos-15 | |
| target: darwin-arm64 | |
| defaults: | |
| run: | |
| working-directory: editors/vscode | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| cache-workspace-crates: true | |
| cache-on-failure: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set build metadata | |
| id: build-metadata | |
| shell: bash | |
| run: | | |
| commit_hash="$(git rev-parse --short "$GITHUB_SHA")" | |
| echo "VIZSLA_COMMIT_HASH=${commit_hash}" >> "$GITHUB_ENV" | |
| echo "commit_hash=${commit_hash}" >> "$GITHUB_OUTPUT" | |
| echo "VIZSLA_BUILD_DATE=$(date -u +'%Y%m%dT%H%M%SZ')" >> "$GITHUB_ENV" | |
| - name: Package extension | |
| run: npm run package:debug -- ${{ matrix.target }} | |
| - name: Upload dev VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vizsla-vscode-dev-${{ matrix.target }}-${{ steps.build-metadata.outputs.commit_hash }} | |
| path: editors/vscode/vizsla-vscode-${{ matrix.target }}-debug.vsix | |
| if-no-files-found: error | |
| retention-days: 14 | |
| dev-alpine-package: | |
| name: Dev Package (${{ matrix.target }}) | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-22.04 | |
| container: ${{ matrix.image }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: alpine-x64 | |
| image: ghcr.io/blackdex/rust-musl:x86_64-musl-nightly | |
| - target: alpine-arm64 | |
| image: ghcr.io/blackdex/rust-musl:aarch64-musl-nightly | |
| defaults: | |
| run: | |
| working-directory: editors/vscode | |
| steps: | |
| - name: Install build dependencies | |
| working-directory: . | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends ca-certificates cmake git python3 | |
| - name: Install Rust components | |
| working-directory: . | |
| run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Trust checkout directories | |
| working-directory: . | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE/crates/slang" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set build metadata | |
| id: build-metadata | |
| shell: bash | |
| working-directory: . | |
| run: | | |
| commit_hash="$(git rev-parse --short "$GITHUB_SHA")" | |
| echo "VIZSLA_COMMIT_HASH=${commit_hash}" >> "$GITHUB_ENV" | |
| echo "commit_hash=${commit_hash}" >> "$GITHUB_OUTPUT" | |
| echo "VIZSLA_BUILD_DATE=$(date -u +'%Y%m%dT%H%M%SZ')" >> "$GITHUB_ENV" | |
| - name: Package extension | |
| run: npm run package:debug -- ${{ matrix.target }} | |
| - name: Upload dev VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vizsla-vscode-dev-${{ matrix.target }}-${{ steps.build-metadata.outputs.commit_hash }} | |
| path: editors/vscode/vizsla-vscode-${{ matrix.target }}-debug.vsix | |
| if-no-files-found: error | |
| retention-days: 14 |