Skip to content

Commit

Permalink
Run async unit tests only with 5.7 toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Sep 30, 2022
1 parent 3e94df2 commit 6cdac18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,27 @@ jobs:
- { os: ubuntu-20.04, toolchain: wasm-5.7.1-RELEASE, wasi-backend: MicroWASI }

runs-on: ${{ matrix.entry.os }}
env:
JAVASCRIPTKIT_WASI_BACKEND: ${{ matrix.entry.wasi-backend }}
SWIFT_VERSION: ${{ matrix.entry.toolchain }}
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Run Test
env:
JAVASCRIPTKIT_WASI_BACKEND: ${{ matrix.entry.wasi-backend }}
- name: Install swiftenv
run: |
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
export SWIFTENV_ROOT="$HOME/.swiftenv"
export PATH="$SWIFTENV_ROOT/bin:$PATH"
eval "$(swiftenv init -)"
SWIFT_VERSION=${{ matrix.entry.toolchain }} make bootstrap
echo $PATH >> $GITHUB_PATH
env >> $GITHUB_ENV
echo ${{ matrix.entry.toolchain }} > .swift-version
make test
- run: make bootstrap
- run: make test
- run: make unittest
if: ${{ startsWith(matrix.toolchain, "wasm-5.7.") }}
- name: Check if SwiftPM resources are stale
run: |
make regenerate_swiftpm_resources
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ build:

.PHONY: test
test:
@echo Running unit tests
swift build --build-tests --triple wasm32-unknown-wasi -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor -Xlinker --export=main
node --experimental-wasi-unstable-preview1 scripts/test-harness.js ./.build/wasm32-unknown-wasi/debug/JavaScriptKitPackageTests.wasm
@echo Running integration tests
cd IntegrationTests && \
CONFIGURATION=debug make test && \
CONFIGURATION=debug SWIFT_BUILD_FLAGS="-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS" make test && \
CONFIGURATION=release make test && \
CONFIGURATION=release SWIFT_BUILD_FLAGS="-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS" make test

.PHONY: unittest
unittest:
@echo Running unit tests
swift build --build-tests --triple wasm32-unknown-wasi -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor -Xlinker --export=main
node --experimental-wasi-unstable-preview1 scripts/test-harness.js ./.build/wasm32-unknown-wasi/debug/JavaScriptKitPackageTests.wasm

.PHONY: benchmark_setup
benchmark_setup:
cd IntegrationTests && CONFIGURATION=release make benchmark_setup
Expand Down

0 comments on commit 6cdac18

Please sign in to comment.