Skip to content

Commit

Permalink
Update testing workflow to modify Package.resolved instead of workaro…
Browse files Browse the repository at this point in the history
…und in Package.swift
  • Loading branch information
liamnichols committed Jul 16, 2024
1 parent 8577423 commit be229f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ jobs:
runs-on: macOS-14
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
SWIFT_SYNTAX_REVISION: ${{ matrix.revision }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Update Package Pins
run: |
jq '(.pins[] | select(.identity == "swift-syntax") | .state.revision) = "${{ matrix.revision }}" | (.pins[] | select(.identity == "swift-syntax") | .state.version) = "${{ matrix.swift-syntax }}"' Package.resolved | sed 's/": /" : /g' > Package.resolved.tmp && mv Package.resolved.tmp Package.resolved
git diff Package.resolved
- name: Run Tests
run: xcodebuild clean test -scheme XCStringsTool-Package -destination platform=macOS
9 changes: 0 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,3 @@ if ProcessInfo.processInfo.environment.keys.contains("BENCHMARK_PACKAGE") {
)
)
}

// Support testing different versions of Swift Syntax
if let revision = ProcessInfo.processInfo.environment["SWIFT_SYNTAX_REVISION"] {
// TODO: The `kind` symbol isn't available in Xcode 15.2? Check newer versions.
package.dependencies.removeAll(where: { $0.url == "https://github.com/swiftlang/swift-syntax" })
package.dependencies.append(
.package(url: "https://github.com/swiftlang/swift-syntax", revision: revision)
)
}

0 comments on commit be229f6

Please sign in to comment.