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

CI: Add a job to check that the wasm32-wasi target builds #117

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
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
55 changes: 55 additions & 0 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: WASM

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-wasi
sugyan marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v4
with:
path: crates
# We use a synthetic crate to ensure no dev-dependencies are enabled, which can
# be incompatible with some of these targets.
- name: Create synthetic crate for testing
run: cargo init --lib ci-build
- name: Copy Rust version into synthetic crate
run: cp crates/rust-toolchain.toml ci-build/
- name: Copy patch directives into synthetic crate
run: |
echo "[patch.crates-io]" >> ./ci-build/Cargo.toml
cat ./crates/Cargo.toml | sed "0,/.\+\(patch.crates.\+\)/d" >> ./ci-build/Cargo.toml
- name: Add atrium-api as a dependency of the synthetic crate
working-directory: ./ci-build
run: >
cargo add
--path ../crates/atrium-api
- name: Add atrium-xrpc as a dependency of the synthetic crate
working-directory: ./ci-build
run: >
cargo add
--path ../crates/atrium-xrpc
- name: Add atrium-xrpc-client as a dependency of the synthetic crate
working-directory: ./ci-build
run: >
cargo add
--path ../crates/atrium-xrpc-client
--no-default-features
- name: Copy pinned dependencies into synthetic crate
run: cp crates/Cargo.lock ci-build/
- name: Add target
working-directory: ./ci-build
run: rustup target add ${{ matrix.target }}
- name: Build for target
working-directory: ./ci-build
run: cargo build --verbose --target ${{ matrix.target }}
Loading