Skip to content

CIでWASMも試す

CIでWASMも試す #20

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/test.yml
- bin/test
- Sources
- Tests
- Package.resolved
- Package.swift
jobs:
test-linux:
runs-on: ubuntu-22.04
env:
SWIFT: swift-DEVELOPMENT-SNAPSHOT-2024-04-02-a
SWIFT_WASM: swift-wasm-DEVELOPMENT-SNAPSHOT-2024-04-03-a
steps:
- run: >
sudo apt-get update &&
sudo apt-get install -y
binutils
git
gnupg2
libc6-dev
libcurl4-openssl-dev
libedit2
libgcc-9-dev
libpython3.8
libsqlite3-0
libstdc++-9-dev
libxml2-dev
libz3-dev
pkg-config
tzdata
unzip
zlib1g-dev
curl
binaryen
libappindicator1
fonts-liberation
- run: |
curl -L -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
working-directory: /home/runner
- run: |
CHROME_VERSION=$(google-chrome --version | cut -f 3 -d ' ' | cut -d '.' -f 1)
CHROMEDRIVER_VERSION=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION")
curl -L -O https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
- uses: actions/checkout@v4
- run: curl -L -O https://download.swift.org/development/ubuntu2204/${{ env.SWIFT }}/${{ env.SWIFT }}-ubuntu22.04.tar.gz
working-directory: /home/runner
- run: tar xzf ${{ env.SWIFT }}-ubuntu22.04.tar.gz
working-directory: /home/runner
- run: echo /home/runner/${{ env.SWIFT }}-ubuntu22.04/usr/bin >> ${GITHUB_PATH}
- run: swift --version
- run: >
swift experimental-sdk install
https://github.com/swiftwasm/swift/releases/download/${{ env.SWIFT_WASM }}/${{ env.SWIFT_WASM }}-ubuntu22.04_x86_64.artifactbundle.zip
- run: git clone --depth 1 https://github.com/swiftwasm/carton
working-directory: /home/runner
- run: swift build -c release
working-directory: /home/runner/carton
- run: echo /home/runner/carton/.build/release >> ${GITHUB_PATH}
- run: >
swift build --experimental-swift-sdk wasm32-unknown-wasi
--build-tests
-Xswiftc -static-stdlib
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor
-Xlinker --export-if-defined=__main_argc_argv
--disable-build-manifest-caching
-Xlinker --stack-first
-Xlinker --global-base=1048576
-Xlinker -z -Xlinker stack-size=1048576
- run: >
CartonFrontend test
--prebuilt-test-bundle-path .build/debug/swift-reactPackageTests.wasm
--environment browser --headless
env:
WEBDRIVER_PATH: /usr/bin/chromedriver
- run: swift package resolve
- run: swift build
- run: swift build --build-tests
- run: swift test