Files
vscode/.github/workflows/pr-linux-cli-test.yml
T
Michael LivelyandCopilot 94c4655a2c ci: switch PR workflows back to 1ES self-hosted runners with JobId (#311975)
* ci: switch PR workflows back to 1ES self-hosted runners with JobId

Reverts the GitHub-hosted runner switch for ubuntu/windows jobs in pr*.yml
and adds a unique JobId label per job, per the IcM mitigation. The JobId
ensures 1ES pool runs are scoped to a specific GitHub Actions run+attempt,
which prevents the cancellation issues that occurred with bare pool labels.

Pool labels:
- 1es-vscode-oss-ubuntu-22.04-x64
- 1es-vscode-oss-windows-2022-x64

macOS jobs (pr-darwin-test.yml, pr-node-modules macOS) remain on
GitHub-hosted runners as no 1ES macOS pool exists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: keep pr-linux-test.yml on ubuntu-24.04 GH-hosted runner

Linux electron tests were stabilized by moving to ubuntu-24.04 in #308495
and #309451. Keep that runner GH-hosted while the rest of the PR workflows
use 1ES self-hosted pools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci: include inputs.job_name in JobId for reusable test workflows

pr-win32-test.yml is invoked 3x from pr.yml (Electron/Browser/Remote) and
without a per-invocation discriminator all 3 jobs share the same JobId
within a run, defeating the 1ES per-job scoping. Add inputs.job_name to
the JobId prefix so each invocation is distinct. Apply the same defense
to pr-linux-cli-test.yml for safety.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 12:53:41 -07:00

49 lines
1.3 KiB
YAML

on:
workflow_call:
inputs:
job_name:
type: string
required: true
rustup_toolchain:
type: string
required: true
jobs:
linux-cli-test:
name: ${{ inputs.job_name }}
runs-on: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64, "JobId=linux-cli-test-${{ inputs.job_name }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
env:
RUSTUP_TOOLCHAIN: ${{ inputs.rustup_toolchain }}
steps:
- name: Checkout microsoft/vscode
uses: actions/checkout@v6
with:
lfs: true
- name: Install Rust
run: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain $RUSTUP_TOOLCHAIN
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Set Rust version
run: |
set -e
rustup default $RUSTUP_TOOLCHAIN
rustup update $RUSTUP_TOOLCHAIN
rustup component add clippy
- name: Check Rust versions
run: |
set -e
rustc --version
cargo --version
- name: Clippy lint
run: cargo clippy -- -D warnings
working-directory: cli
- name: 🧪 Run unit tests
run: cargo test
working-directory: cli