Implement v8 engine #141
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 | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
features: ["quick-js", "duktape", "v8"] | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Set up rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Cache rust artifacts | |
uses: Swatinem/rust-cache@v1 | |
with: | |
key: ${{ matrix.features }} | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --no-default-features --features ${{ matrix.features }} | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --no-default-features --features ${{ matrix.features }} --no-fail-fast | |
test-wasm-browser: | |
name: "test (wasm-js browser)" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Set up rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: Set up Chrome | |
uses: nanasess/setup-chromedriver@master | |
- name: Set up wasm-pack | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Cache rust artifacts | |
uses: Swatinem/rust-cache@v1 | |
- name: Run wasm-pack test | |
run: | | |
wasm-pack test --chrome --headless --no-default-features --features wasm-js,wasm-js-test-in-browser | |
test-wasm-node: | |
name: "test (wasm-js node)" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Set up rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
- name: Set up wasm-pack | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Cache rust artifacts | |
uses: Swatinem/rust-cache@v1 | |
- name: Run wasm-pack test | |
run: | | |
wasm-pack test --node --no-default-features --features wasm-js | |
deploy: | |
if: startsWith(github.ref, 'refs/tags/') | |
name: deploy | |
runs-on: ubuntu-latest | |
needs: [test, test-wasm-browser, test-wasm-node] | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Get release version | |
run: | | |
TAG_VERSION="${GITHUB_REF#refs/tags/}" | |
echo "TAG_VERSION=${TAG_VERSION}" >> $GITHUB_ENV | |
echo "version is: ${TAG_VERSION}" | |
- name: Set up rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Login to crates.io | |
uses: actions-rs/cargo@v1 | |
with: | |
command: login | |
args: ${{ secrets.CRATES_TOKEN }} | |
- name: Run cargo publish | |
uses: actions-rs/cargo@v1 | |
with: | |
command: publish | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.TAG_VERSION }} | |
name: Release ${{ env.TAG_VERSION }} | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |