diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6e5d1ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.74.0 + - name: Cache WASI VFS + id: cache-wasi-vfs + uses: actions/cache@v4 + with: + path: /usr/local/bin/wasi-vfs + key: ${{ runner.os }}-wasi-vfs + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + - uses: actions/setup-node@v4 + with: + cache: yarn + - name: Install wasi-vfs + if: steps.cache-wasi-vfs.outputs.cache-hit != 'true' + run: | + curl -LO "https://github.com/kateinoigakukun/wasi-vfs/releases/download/v0.5.2/wasi-vfs-cli-x86_64-unknown-linux-gnu.zip" + unzip wasi-vfs-cli-x86_64-unknown-linux-gnu.zip + mv wasi-vfs /usr/local/bin/wasi-vfs + - name: Cache ruby.wasm artefacts + id: cache-ruby-wasm + uses: actions/cache@v4 + with: + path: | + build + rubies + key: ${{ runner.os }}-ruby-wasm + - name: Cache compiled ruby.wasm module + id: cache-ruby-wasm-module + uses: actions/cache@v4 + with: + path: | + src/ruby.wasm + key: ${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }}-ruby-wasm-module + - name: Build ruby.wasm + if: steps.cache-ruby-wasm-module.outputs.cache-hit != 'true' + run: | + sudo apt-get update + sudo apt-get -yqq install zlib1g-dev + bundle exec rbwasm build -o src/ruby.wasm --ruby-version 3.2 + - name: Build web app + run: | + yarn build diff --git a/.gitignore b/.gitignore index 70e8212..a1e929a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ tmp/ dist/ -gemfiles/*.lock -Gemfile.lock - mspec/ .rbnext/ rubyspec_temp/ diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..9eb1777 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,39 @@ +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + diff-lcs (1.5.0) + js (2.4.1.pre.1) + paco (0.2.3) + parser (3.3.0.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + require-hooks (0.2.2) + ruby-next (1.0.0) + paco (~> 0.2) + require-hooks (~> 0.2) + ruby-next-core (= 1.0.0) + ruby-next-parser (>= 3.2.2.0) + unparser (~> 0.6.0) + ruby-next-core (1.0.0) + ruby-next-parser (3.2.2.0) + parser (>= 3.0.3.1) + ruby_wasm (2.5.0.pre.1) + unparser (0.6.12) + diff-lcs (~> 1.3) + parser (>= 3.2.2.4) + +PLATFORMS + arm64-darwin-21 + aarch64-linux + x86_64-linux + ruby + +DEPENDENCIES + js (~> 2.4.1.pre.1) + ruby-next (~> 1.0) + ruby_wasm (~> 2.5.pre.1) + +BUNDLED WITH + 2.5.3