Skip to content

Harden Windows PowerShell 5.1 boundaries #48

Harden Windows PowerShell 5.1 boundaries

Harden Windows PowerShell 5.1 boundaries #48

Workflow file for this run

name: Validate
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: validate-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: windows-latest
timeout-minutes: 20
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Setup Node
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 24
cache: npm
- name: Validate repository hygiene
run: npm run validate:repo
- name: Install
run: npm ci
- name: Validate bundled Mihomo
run: npm run validate:mihomo
- name: Typecheck
run: npm run typecheck
- name: Test
# Avoid passing PowerShell 7's PSModulePath through npm/Node into Windows PowerShell 5.1.
# The product/test launcher also scrubs it; the cache setting is a separate parallel-run guard.
shell: cmd
env:
PSModuleAnalysisCachePath: NUL
run: npm test
- name: Test Worker maintenance
run: npm run test:worker
- name: Typecheck Worker
run: npm run typecheck:worker
- name: Build Worker
run: npm run build:worker
- name: Lint
run: npm run lint --if-present
- name: Check formatting
run: npm run format:check --if-present
- name: Build
run: npm run build