Skip to content

Commit

Permalink
ci: add test/release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Sep 25, 2024
1 parent 4be4048 commit 95d4602
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Release

on:
release:
types:
- created

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Extism
run: |
curl -O https://raw.githubusercontent.com/extism/js-pdk/main/install.sh
sh install.sh
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14' # Specify the Node.js version you need

- name: Install
run: |
npm i
npm install -g ejs-lint
- name: Build
run: |
npm run build
- name: Run bundle script
run: ./bundle.sh

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bundle.zip
asset_name: bundle.zip
asset_content_type: application/zip


68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run Tests

on:
workflow_dispatch:
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout repository
uses: actions/checkout@v4
repository: extism/python-pdk
path: python-pdk

- name: Setup Extism and XTP
run: |
curl -O https://raw.githubusercontent.com/extism/js-pdk/main/install.sh
sh install.sh
curl https://static.dylibso.com/cli/install.sh | sh
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21'

- name: Install extism-py
run: |
cd python-pdk && ./build.py install
- name: Install
run: |
npm ci
npm install -g ejs-lint
- name: Build
run: |
npm run build
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-wasi

- name: Check Rust Version
run: rustc --version

- name: Run test script
run: |
cd tests && ./test.sh
- name: Run Bindgen Test
run: |
sh bindgen-test.sh install
sh bindgen-test.sh run

0 comments on commit 95d4602

Please sign in to comment.