Merge pull request #10 from ydnar/main #42
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: wasmtime | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
workflow_dispatch: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
- name: npm install | |
run: npm install | |
- name: npm run build | |
run: npm run package | |
env: | |
NODE_OPTIONS: --openssl-legacy-provider | |
- name: upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: setup-wasmtime | |
path: dist/wasmtime/setup/index.js | |
setup-default: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasmtime | |
path: dist/wasmtime/setup/ | |
- name: setup wasmtime | |
uses: ./wasmtime/setup/ | |
with: | |
github_token: ${{ github.token }} | |
- name: verify wasmtime setup | |
run: wasmtime --version | |
setup-version: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
version: ["12.0.0", "17.0.0"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasmtime | |
path: dist/wasmtime/setup/ | |
- name: setup wasmtime | |
uses: ./wasmtime/setup/ | |
with: | |
version: ${{ matrix.version }} | |
github_token: ${{ github.token }} | |
- name: setup wasmtime with v | |
uses: ./wasmtime/setup/ | |
with: | |
version: v${{ matrix.version }} | |
github_token: ${{ github.token }} | |
- name: wasmtime setup successful | |
if: ${{ contains(env.WASMTIME_VERSION, matrix.version) }} | |
run: echo "wasmtime setup successful" | |
- name: wasmtime setup failed | |
if: ${{ !contains(env.WASMTIME_VERSION, matrix.version) }} | |
run: | | |
echo "expected version: ${{ matrix.version }}, found: ${{ env.WASMTIME_VERSION }}" | |
exit 1 | |
setup-v-version: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
version: ["12.0.0", "17.0.0"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasmtime | |
path: dist/wasmtime/setup/ | |
- name: setup wasmtime with v-prefixed version | |
uses: ./wasmtime/setup/ | |
with: | |
version: v${{ matrix.version }} | |
github_token: ${{ github.token }} | |
- name: wasmtime setup successful | |
if: ${{ contains(env.WASMTIME_VERSION, matrix.version) }} | |
run: echo "wasmtime setup successful" | |
- name: wasmtime setup failed | |
if: ${{ !contains(env.WASMTIME_VERSION, matrix.version) }} | |
run: | | |
echo "expected version: ${{ matrix.version }}, found: ${{ env.WASMTIME_VERSION }}" | |
exit 1 |