CI #1009
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: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || 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: Setup Rust | |
| uses: ./.github/actions/setup-rust | |
| - name: Setup sccache | |
| uses: ./.github/actions/setup-sccache | |
| with: | |
| cmake-launcher: "true" | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-rust-lint | |
| cache-workspace-crates: true | |
| - name: Format check | |
| run: cargo fmt --all -- --check | |
| - name: Generated configuration check | |
| run: cargo xtask check-config-artifacts | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| rust-test: | |
| name: Rust Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Rust | |
| uses: ./.github/actions/setup-rust | |
| - name: Setup sccache | |
| uses: ./.github/actions/setup-sccache | |
| with: | |
| cmake-launcher: "true" | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-rust-test-${{ runner.os }} | |
| cache-workspace-crates: true | |
| - name: Test | |
| run: 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: 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 | |
| vscode-web-smoke: | |
| name: VS Code Web Smoke | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: editors/vscode | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Prepare Vide LSP WASM | |
| uses: ./.github/actions/prepare-vide-lsp-wasm | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| editors/vscode/package-lock.json | |
| editors/vscode/test-web/package-lock.json | |
| - name: Install extension dependencies | |
| run: npm ci | |
| - name: Install web smoke dependencies | |
| working-directory: editors/vscode/test-web | |
| run: npm ci | |
| - name: Read VS Code Web version | |
| id: vscode-web-version | |
| working-directory: editors/vscode/test-web | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| vscode_commit="$(node -p "require('./package.json').config.vscodeWebCommit")" | |
| [[ "${vscode_commit}" =~ ^[0-9a-f]{40}$ ]] | |
| echo "commit=${vscode_commit}" >> "${GITHUB_OUTPUT}" | |
| echo "folder=vscode-web-stable-${vscode_commit}" >> "${GITHUB_OUTPUT}" | |
| - name: Restore VS Code Web cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: editors/vscode/test-web/.vscode-test-web | |
| key: ${{ steps.vscode-web-version.outputs.folder }} | |
| - name: Download VS Code Web | |
| working-directory: editors/vscode/test-web | |
| env: | |
| VSCODE_WEB_COMMIT: ${{ steps.vscode-web-version.outputs.commit }} | |
| VSCODE_WEB_FOLDER: ${{ steps.vscode-web-version.outputs.folder }} | |
| run: | | |
| set -euo pipefail | |
| vscode_dir=".vscode-test-web/${VSCODE_WEB_FOLDER}" | |
| if [ ! -f "${vscode_dir}/version" ]; then | |
| archive="${RUNNER_TEMP}/vscode-web.tar.gz" | |
| curl --fail --location --retry 10 --retry-all-errors \ | |
| --output "${archive}" \ | |
| "https://vscode.download.prss.microsoft.com/dbazure/download/stable/${VSCODE_WEB_COMMIT}/vscode-web.tar.gz" | |
| rm -rf "${vscode_dir}" | |
| mkdir -p "${vscode_dir}" | |
| tar -xzf "${archive}" --strip-components=1 -C "${vscode_dir}" | |
| printf '%s' "${VSCODE_WEB_FOLDER}" > "${vscode_dir}/version" | |
| fi | |
| - name: Web smoke test | |
| run: npm run test:web | |
| conclusion: | |
| name: CI Success | |
| needs: [rust-lint, rust-test, vscode-extension, vscode-web-smoke] | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check required jobs | |
| env: | |
| RESULTS: ${{ toJSON(needs) }} | |
| run: jq --exit-status 'all(.result == "success")' <<< "${RESULTS}" |