Skip to content

Commit

Permalink
Pin the current toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
kkebo committed Jul 31, 2023
1 parent f3ef388 commit 3c57db2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Get versions
run: |
sudo xcode-select -s /Applications/Xcode_15.0.app
xcodebuild -version
swift --version
- name: Install Swift nightly toolchain
run: |
VERSION=swift-DEVELOPMENT-SNAPSHOT-2023-07-23-a
TOOLCHAIN_URL="https://download.swift.org/development/xcode/$VERSION/$VERSION-osx.pkg"
curl -LO $TOOLCHAIN_URL
installer -target CurrentUserHomeDirectory -pkg $VERSION-osx.pkg
echo "PATH=$HOME/Library/Developer/Toolchains/$VERSION.xctoolchain/usr/bin:${PATH}" >> $GITHUB_ENV
- name: Get Swift version
run: swift --version
- name: Build
run: swift build
- name: Run tests
Expand Down
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEVELOPMENT-SNAPSHOT-2023-07-23-a
2 changes: 1 addition & 1 deletion Benchmarks/Benchmarks/MyBenchmark/MyBenchmark.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let benchmarks = {

Benchmark("TokenizerBenchmark", configuration: .init(scalingFactor: .mega)) { benchmark in
let sink = TestSink()
var tokenizer = Tokenizer(sink: consume sink)
var tokenizer = Tokenizer(sink: sink)
var iter = html.makeIterator()
benchmark.startMeasurement()
for _ in benchmark.scaledIterations {
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ let package = Package(
.testTarget(
name: "TokenizerTests",
dependencies: [
"Tokenizer"
"TokenizerMacros",
"Tokenizer",
]
),
]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ TODO ([The main blocker is the lack of macros support in Linux.](https://forums.
You need:

- Xcode 15 or later
- Swift nightly toolchain

And then, run the following command to build the source code.

Expand Down
2 changes: 1 addition & 1 deletion Sources/Tokenizer/Tokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public struct Tokenizer<Sink: TokenSink>: ~Copyable {
input = consume initial
return nil
}
guard consume c == consume pc else {
guard c == pc else {
input = consume initial
return false
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/TokenizerTests/TokenizerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class TokenizerTests: XCTestCase {
"""#

let sink = TestSink()
var tokenizer = Tokenizer(sink: consume sink)
var tokenizer = Tokenizer(sink: sink)
var iter = html.makeIterator()
tokenizer.tokenize(&iter)

Expand Down

0 comments on commit 3c57db2

Please sign in to comment.