initial wasm32 'support' #324
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone spacebar server | |
run: | | |
git clone https://github.com/bitfl0wer/server.git | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: server/package-lock.json | |
- name: Prepare and start Spacebar server | |
run: | | |
npm install | |
npm run setup | |
npm run start & | |
working-directory: ./server | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
prefix-key: "linux" | |
- name: Build, Test and Publish Coverage | |
run: | | |
rustup target add wasm32-unknown-unknown | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then | |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
cargo binstall --no-confirm cargo-tarpaulin --force | |
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120 | |
else | |
echo "Code Coverage step is skipped on forks!" | |
cargo build --verbose --all-features | |
cargo test --verbose --all-features | |
fi | |
GECKODRIVER=/usr/local/share/gecko_driver CHROMEDRIVER=/usr/local/share/chromedriver-linux64 cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt" | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone spacebar server | |
run: | | |
git clone https://github.com/bitfl0wer/server.git | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: server/package-lock.json | |
- name: Prepare and start Spacebar server | |
run: | | |
npm install | |
npm run setup | |
npm run start & | |
working-directory: ./server | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
prefix-key: "macos" | |
- name: Build, Test wasm with Safari | |
run: | | |
rustup target add wasm32-unknown-unknown | |
SAFARIDRIVER=$(which safaridriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt" |