Skip to content

Commit 3ba2bf0

Browse files
committed
ci: add build action
1 parent 1ce5d87 commit 3ba2bf0

File tree

3 files changed

+99
-3
lines changed

3 files changed

+99
-3
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-rust-lang/setup-rust-toolchain@v1
16+
with:
17+
toolchain: 1.74.0
18+
- name: Cache WASI VFS
19+
id: cache-wasi-vfs
20+
uses: actions/cache@v4
21+
with:
22+
path: /usr/local/bin/wasi-vfs
23+
key: ${{ runner.os }}-wasi-vfs
24+
- uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 3.2
27+
bundler-cache: true
28+
- uses: actions/setup-node@v4
29+
with:
30+
cache: yarn
31+
- name: Install wasi-vfs
32+
if: steps.cache-wasi-vfs.outputs.cache-hit != 'true'
33+
run: |
34+
curl -LO "https://github.com/kateinoigakukun/wasi-vfs/releases/download/v0.5.2/wasi-vfs-cli-x86_64-unknown-linux-gnu.zip"
35+
unzip wasi-vfs-cli-x86_64-unknown-linux-gnu.zip
36+
mv wasi-vfs /usr/local/bin/wasi-vfs
37+
- name: Cache ruby.wasm artefacts
38+
id: cache-ruby-wasm
39+
uses: actions/cache@v4
40+
with:
41+
path: |
42+
build
43+
rubies
44+
key: ${{ runner.os }}-ruby-wasm
45+
- name: Cache compiled ruby.wasm module
46+
id: cache-ruby-wasm-module
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
src/ruby.wasm
51+
key: ${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }}-ruby-wasm-module
52+
- name: Build ruby.wasm
53+
if: steps.cache-ruby-wasm-module.outputs.cache-hit != 'true'
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get -yqq install zlib1g-dev
57+
bundle exec rbwasm build -o src/ruby.wasm --ruby-version 3.2
58+
- name: Build web app
59+
run: |
60+
yarn build

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
tmp/
88
dist/
99

10-
gemfiles/*.lock
11-
Gemfile.lock
12-
1310
mspec/
1411
.rbnext/
1512
rubyspec_temp/

Gemfile.lock

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.2)
5+
diff-lcs (1.5.0)
6+
js (2.4.1.pre.1)
7+
paco (0.2.3)
8+
parser (3.3.0.4)
9+
ast (~> 2.4.1)
10+
racc
11+
racc (1.7.3)
12+
require-hooks (0.2.2)
13+
ruby-next (1.0.0)
14+
paco (~> 0.2)
15+
require-hooks (~> 0.2)
16+
ruby-next-core (= 1.0.0)
17+
ruby-next-parser (>= 3.2.2.0)
18+
unparser (~> 0.6.0)
19+
ruby-next-core (1.0.0)
20+
ruby-next-parser (3.2.2.0)
21+
parser (>= 3.0.3.1)
22+
ruby_wasm (2.5.0.pre.1)
23+
unparser (0.6.12)
24+
diff-lcs (~> 1.3)
25+
parser (>= 3.2.2.4)
26+
27+
PLATFORMS
28+
arm64-darwin-21
29+
aarch64-linux
30+
x86_64-linux
31+
ruby
32+
33+
DEPENDENCIES
34+
js (~> 2.4.1.pre.1)
35+
ruby-next (~> 1.0)
36+
ruby_wasm (~> 2.5.pre.1)
37+
38+
BUNDLED WITH
39+
2.5.3

0 commit comments

Comments
 (0)