Skip to content

Commit 1f30d3f

Browse files
authored
feat: added fallback windows installation without caching support
1 parent dc93ecd commit 1f30d3f

File tree

17 files changed

+441
-187
lines changed

17 files changed

+441
-187
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugins": ["jest", "@typescript-eslint"],
3-
"extends": ["plugin:github/recommended"],
3+
"extends": ["plugin:github/recommended","plugin:@typescript-eslint/recommended"],
44
"parser": "@typescript-eslint/parser",
55
"parserOptions": {
66
"ecmaVersion": 9,

.github/workflows/main.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ jobs:
145145
if: needs.ci.outputs.run == 'true'
146146
needs: ci
147147
runs-on: ${{ matrix.os }}
148-
continue-on-error: ${{ matrix.os == 'windows-latest' && matrix.swift == 'latest' }}
149148
concurrency:
150149
group: integration-test-${{ github.ref }}-${{ matrix.os }}-${{ matrix.swift }}-${{ matrix.development }}
151150
cancel-in-progress: true
@@ -172,7 +171,6 @@ jobs:
172171
- os: ubuntu-22.04
173172
swift: ${{ fromJSON(vars.SETUPSWIFT_CUSTOM_TOOLCHAINS).ubuntu2204 }}
174173
development: true
175-
noverify: true
176174

177175
steps:
178176
- name: Checkout repository
@@ -205,13 +203,17 @@ jobs:
205203
cache-snapshot: ${{ !matrix.development }}
206204

207205
- name: Verify Swift version in macos
208-
if: runner.os == 'macOS' && matrix.noverify != 'true'
206+
if: runner.os == 'macOS'
209207
run: xcrun --toolchain ${{ env.TOOLCHAINS || '""' }} swift --version | grep ${{ steps.setup-swift.outputs.swift-version }} || exit 1
210208

211209
- name: Verify Swift version
212-
if: matrix.noverify != 'true'
213210
run: swift --version | grep ${{ steps.setup-swift.outputs.swift-version }} || exit 1
214211

212+
- name: Verify Swift REPL
213+
if: runner.os == 'Windows'
214+
shell: powershell
215+
run: $env:SWIFTFLAGS
216+
215217
dry-run:
216218
name: Check action with dry run
217219
if: needs.ci.outputs.run == 'true'
@@ -263,7 +265,6 @@ jobs:
263265
if: needs.ci.outputs.run == 'true'
264266
needs: ci
265267
runs-on: ${{ matrix.os }}
266-
continue-on-error: ${{ matrix.os == 'windows-latest' }}
267268
concurrency:
268269
group: e2e-test-${{ github.ref }}-${{ matrix.os }}
269270
cancel-in-progress: true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
[GitHub Action](https://github.com/features/actions) that will setup [Swift](https://swift.org) environment with specified version.
1111
This action supports the following functionalities:
1212

13-
- Works on Linux, macOS and Windows(Swift 5.10 and after not supported on Windows).
13+
- Works on Linux, macOS and Windows.
1414
- Supports [installing latest major/minor/patch](#specifying-version).
1515
- Provides snapshots as soon as published in `swift.org`.
1616
- Verifies toolchain snapshots before installation (`gpg` for Linux and Windows, `pkgutil` for macOS) .
1717
- Allows development snapshots by enabling `development` flag and optional version.
1818
- Prefers existing Xcode installations.
19-
- Caches installed setup in tool cache.
19+
- Caches installed setup in tool cache and actions cache(Swift 5.10 and after does not support caching on Windows).
2020
- Allows fetching snapshot metadata without installation (can be used to setup docker images).
2121

2222
## Latest supported toolchains

__tests__/installer/windows.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ describe('windows toolchain installation verification', () => {
188188
const setupSpy = jest
189189
.spyOn(VisualStudio, 'setup')
190190
.mockResolvedValue(visualStudio)
191-
jest.spyOn(fs, 'access').mockImplementation(p => {
191+
jest.spyOn(fs, 'access').mockImplementation(async p => {
192192
if (
193193
typeof p === 'string' &&
194194
(p.startsWith(path.join(cached, 'Developer')) ||

0 commit comments

Comments
 (0)