Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WAMR for carton test #195

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 6 additions & 47 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,16 @@ on:
branches: [main]

jobs:
catalina-swift5_2:
runs-on: macos-10.15

steps:
- uses: actions/checkout@v2
- name: Build on macOS 10.15 with Swift 5.2
run: |
sudo xcode-select --switch /Applications/Xcode_11.7.app/Contents/Developer
swift test -c release --enable-test-discovery
swift build -c release
brew bundle
cd TestApp && ../.build/release/carton test
../.build/release/carton test --environment defaultBrowser
../.build/release/carton bundle
# the token is required to get around GitHub API limits when downloading the toolchain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

bigsur-swift5_2:
runs-on: macos-11.0

steps:
- uses: actions/checkout@v2
- name: Build on macOS 11.0 with Swift 5.2
run: |
sudo xcode-select --switch /Applications/Xcode_11.7.app/Contents/Developer
swift test -c release --enable-test-discovery
swift build -c release
brew bundle
cd TestApp && ../.build/release/carton test
../.build/release/carton test --environment defaultBrowser
../.build/release/carton bundle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

catalina-swift5_3:
runs-on: macos-10.15

steps:
- uses: actions/checkout@v2
- name: Build on macOS 10.15 with Swift 5.3
run: |
sudo xcode-select --switch /Applications/Xcode_12.app/Contents/Developer
swift test -c release --enable-test-discovery
sudo xcode-select --switch /Applications/Xcode_12.3.app/Contents/Developer
swift build -c release
swift test -c release --enable-test-discovery
brew bundle
cd TestApp && ../.build/release/carton test
../.build/release/carton test --environment defaultBrowser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed. It's included in the CI Tests now.

If we are going to build before tests it should be

swift build --build-tests --enable-test-discovery
swift test --enable-test-discovery

Expand All @@ -66,9 +31,9 @@ jobs:
- uses: actions/checkout@v2
- name: Build on macOS 11.0 with Swift 5.3
run: |
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer
swift test -c release --enable-test-discovery
sudo xcode-select --switch /Applications/Xcode_12.3.app/Contents/Developer
swift build -c release
swift test -c release --enable-test-discovery
thecb4 marked this conversation as resolved.
Show resolved Hide resolved
brew bundle
cd TestApp && ../.build/release/carton test
../.build/release/carton test --environment defaultBrowser
Expand All @@ -84,11 +49,8 @@ jobs:

- name: Build on Ubuntu 18.04 with Swift 5.3
run: |
swift test -c release --enable-test-discovery
swift build -c release
sudo ./install_ubuntu_deps.sh
curl https://get.wasmer.io -sSfL | sh
source /home/runner/.wasmer/wasmer.sh
swift test -c release --enable-test-discovery
cd TestApp && ../.build/release/carton test
../.build/release/carton bundle
env:
Expand All @@ -101,11 +63,8 @@ jobs:
- uses: actions/checkout@v2
- name: Build on Ubuntu 20.04 with Swift 5.3
run: |
swift test -c release --enable-test-discovery
swift build -c release
sudo ./install_ubuntu_deps.sh
curl https://get.wasmer.io -sSfL | sh
source /home/runner/.wasmer/wasmer.sh
swift test -c release --enable-test-discovery
cd TestApp && ../.build/release/carton test
../.build/release/carton bundle
env:
Expand Down
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
--ifdef noindent
--stripunusedargs closure-only
--disable andOperator
--swiftversion 5.2
--swiftversion 5.3
--maxwidth 100
1 change: 0 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ brew "pre-commit"
brew "swiftformat"
brew "swiftlint"
brew "binaryen"
brew "wasmer"
25 changes: 0 additions & 25 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,6 @@
}
}
}
},
"wasmer": {
"version": "0.16.2",
"bottle": {
"cellar": ":any_skip_relocation",
"prefix": "/usr/local",
"files": {
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/wasmer-0.16.2.big_sur.bottle.tar.gz",
"sha256": "63d91bbfece68628e7bb464cd8d3a90a6dc89344c4889ada157f174db62f05da"
},
"catalina": {
"url": "https://homebrew.bintray.com/bottles/wasmer-0.16.2.catalina.bottle.tar.gz",
"sha256": "751b4b059036dbca254eef935bc03240e1fd559465a376a0cff8f5a41dcd3980"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/wasmer-0.16.2.mojave.bottle.tar.gz",
"sha256": "725d2b857e0954b1e2fd8a01021847e168d5daec33cd76c32f90a0ae12fdf422"
},
"high_sierra": {
"url": "https://homebrew.bintray.com/bottles/wasmer-0.16.2.high_sierra.bottle.tar.gz",
"sha256": "42ea898c1ebd9c0ac58bf21117c05df6a4726123590444c19173a01586c80c63"
}
}
}
}
}
},
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && ap
libsqlite3-0 \
libsqlite3-dev \
curl unzip \
&& export WASMER_DIR=/usr/local && curl https://get.wasmer.io -sSfL | sh && \
rm -r /var/lib/apt/lists/*
&& rm -r /var/lib/apt/lists/*

ENV CARTON_ROOT=/root/.carton
ENV CARTON_DEFAULT_TOOLCHAIN=wasm-5.3.1-RELEASE
Expand All @@ -28,8 +27,7 @@ RUN cd carton && \
swift build -c release && \
cd TestApp && ../.build/release/carton test && cd .. && \
mv .build/release/carton /usr/bin && \
cd .. && \
rm -rf carton /tmp/wasmer*
cd ..

# Set the default command to run
CMD ["carton --help"]
11 changes: 10 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,18 @@
"version": "4.36.2"
}
},
{
"package": "WAMR",
"repositoryURL": "https://github.com/swiftwasm/wamr-swift.git",
"state": {
"branch": "main",
"revision": "f06c454fd9c16d5a00c8bdece0b0a57e0bb82f43",
"version": null
}
},
{
"package": "WasmTransformer",
"repositoryURL": "https://github.com/swiftwasm/WasmTransformer",
"repositoryURL": "https://github.com/swiftwasm/WasmTransformer.git",
"state": {
"branch": null,
"revision": "74bd6559322b43390eb6da5a134f5af7f117bd01",
Expand Down
24 changes: 9 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let package = Package(
.library(name: "CartonKit", targets: ["CartonKit"]),
.library(name: "CartonCLI", targets: ["CartonCLI"]),
.executable(name: "carton", targets: ["Carton"]),
.executable(name: "carton-release", targets: ["carton-release"]),
.executable(name: "carton-release", targets: ["CartonRelease"]),
],
dependencies: [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.2.2"),
Expand All @@ -34,26 +34,19 @@ let package = Package(
.package(url: "https://github.com/vapor/vapor.git", from: "4.29.3"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.1.0"),
.package(url: "https://github.com/JohnSundell/Splash.git", from: "0.14.0"),
.package(url: "https://github.com/swiftwasm/WasmTransformer", .upToNextMinor(from: "0.0.2")),
.package(
url: "https://github.com/swiftwasm/WasmTransformer.git",
.upToNextMinor(from: "0.0.2")
),
.package(name: "WAMR", url: "https://github.com/swiftwasm/wamr-swift.git", .branch("main")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module
// or a test suite. Targets can depend on other targets in this package, and on
// products in packages which this package depends on.
.target(
name: "Carton",
dependencies: [
"CartonCLI",
// commented out for now. Will remove once confirmed working
// .product(name: "ArgumentParser", package: "swift-argument-parser"),
// .product(name: "AsyncHTTPClient", package: "async-http-client"),
// .product(name: "Crypto", package: "swift-crypto"),
// .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
// .product(name: "Vapor", package: "vapor"),
// "CartonHelpers",
// openCombineProduct,
// "SwiftToolchain",
]
dependencies: ["CartonCLI"]
),
.target(
name: "CartonCLI",
Expand All @@ -70,6 +63,7 @@ let package = Package(
"CartonHelpers",
openCombineProduct,
"SwiftToolchain",
"WAMR",
]
),
.target(
Expand All @@ -94,7 +88,7 @@ let package = Package(
// This target is used only for release automation tasks and
// should not be installed by `carton` users.
.target(
name: "carton-release",
name: "CartonRelease",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
Expand Down
115 changes: 0 additions & 115 deletions [email protected]

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ development workflow such as toolchain and SDK installations.

### Requirements

- macOS 10.15 and Xcode 11.4 or later.
- [Swift 5.2 or later](https://swift.org/download/) and Ubuntu 18.04 or 20.04 for Linux users.
- macOS 10.15 and Xcode 12.0 or later.
- [Swift 5.3 or later](https://swift.org/download/) and Ubuntu 18.04 or 20.04 for Linux users.

### Installation

Expand Down Expand Up @@ -170,7 +170,7 @@ Refer to [the pre-commit documentation page](https://pre-commit.com/) for more d
and installation instructions for other platforms.

SwiftFormat and SwiftLint also run on CI for every PR and thus a CI build can
fail with incosistent formatting or style. We require CI builds to pass for all
fail with inconsistent formatting or style. We require CI builds to pass for all
PRs before merging.

### Code of Conduct
Expand Down
Loading