Skip to content

Commit

Permalink
ci: add build action
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jan 23, 2024
1 parent 1ce5d87 commit 3ba2bf0
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
tmp/
dist/

gemfiles/*.lock
Gemfile.lock

mspec/
.rbnext/
rubyspec_temp/
Expand Down
39 changes: 39 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3ba2bf0

Please sign in to comment.