Setup Windows GH actions job #33
Workflow file for this run
This file contains 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: Pull request | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
soundness: | |
name: Soundness | |
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main | |
with: | |
# Pending https://github.com/swiftlang/vscode-swift/pull/1176 | |
license_header_check_enabled: false | |
license_header_check_project_name: "VS Code Swift" | |
api_breakage_check_enabled: false | |
docs_check_enabled: false | |
format_check_enabled: false | |
shell_check_enabled: true | |
unacceptable_language_check_enabled: true | |
tests: | |
name: Test | |
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main | |
with: | |
linux_exclude_swift_versions: '[{"swift_version": "nightly-main"}]' | |
linux_env_vars: | | |
NODE_VERSION=v18.19.0 | |
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin | |
NVM_DIR=/usr/local/nvm | |
CI=1 | |
FAST_TEST_RUN=1 | |
linux_pre_build_command: | | |
apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential | |
mkdir -p $NVM_DIR | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | |
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION" | |
echo "$NODE_PATH" >> $GITHUB_PATH | |
linux_build_command: ./docker/test.sh | |
enable_windows_checks: false | |
tests-windows: | |
name: Windows (${{ matrix.swift_version }}) | |
runs-on: ${{ contains(matrix.swift_version, 'nightly') && 'windows-2019' || 'windows-2022' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
swift_version: ['5.9', '5.10', '6.0', 'nightly', 'nightly-6.0'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install winget | |
uses: Cyberboss/install-winget@main | |
- name: Create test script | |
run: | | |
mkdir $env:TEMP\test-script | |
echo 'Set-PSDebug -Trace 1' >> $env:TEMP\test-script\run.ps1 | |
echo '$ErrorActionPreference = "Stop"' >> $env:TEMP\test-script\run.ps1 | |
echo 'winget install --id Microsoft.VisualStudio.2022.Community --exact --force --custom "--add Microsoft.VisualStudio.Component.Windows11SDK.22000 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" --disable-interactivity --accept-source-agreements' >> $env:TEMP\test-script\run.ps1 | |
echo 'winget install --id Swift.Toolchain -e --disable-interactivity --accept-source-agreements' >> $env:TEMP\test-script\run.ps1 | |
echo 'winget install --id Schniz.fnm -e --disable-interactivity --accept-source-agreements' >> $env:TEMP\test-script\run.ps1 | |
echo 'refreshenv' >> $env:TEMP\test-script\run.ps1 | |
echo 'fnm env --use-on-cd | Out-String | Invoke-Expression' >> $env:TEMP\test-script\run.ps1 | |
echo 'fnm use --install-if-missing 18.19.0' >> $env:TEMP\test-script\run.ps1 | |
echo 'swift --version' >> $env:TEMP\test-script\run.ps1 | |
echo 'node --version' >> $env:TEMP\test-script\run.ps1 | |
echo 'cd $env:GITHUB_WORKSPACE' >> $env:TEMP\test-script\run.ps1 | |
echo 'docker\test-windows.ps1' >> $env:TEMP\test-script\run.ps1 | |
powershell.exe -NoLogo -File $env:TEMP\test-script\run.ps1 |