Skip to content

add zola slug strategy #188

add zola slug strategy

add zola slug strategy #188

Workflow file for this run

name: Test
# Run tests only.
#
# This workflow is designed to be run on PR to validate commits.
# It can be seen as a short version of `main.yml`.
on:
pull_request:
branches: ["master"]
# Sometimes we want to test a few minor changes.
# To avoid triggering the workflow twice,
# this is only enabled for branch names that are very unlikely to be a PR head.
push:
branches: ["dev/-/**"]
paths:
- "src/**"
- "package-lock.json"
- "!**.md"
workflow_dispatch:
repository_dispatch:
types: ["test"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Setup Node.js environment"
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Setup Rust Toolchain for GitHub CI
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: "Install dependencies"
run: |
npm run build-wasm
npm ci
- name: "Build debug"
run: |
export NODE_ENV='development'
export RELEASE_DIR='tmp_debug'
export VSIX_FILE='debug.vsix'
npx vsce package --pre-release --out $VSIX_FILE
unzip $VSIX_FILE -d $RELEASE_DIR
export WASM_FILE=$(find ${RELEASE_DIR}/extension/dist -name "*.wasm" -print -quit)
mv $WASM_FILE ${RELEASE_DIR}/extension/dist/zola_slug_bg.wasm
cd $RELEASE_DIR
zip -r ../${RELEASE_DIR}.zip .
cd ..
mv ${RELEASE_DIR}.zip $VSIX_FILE
- name: Test
uses: GabrielBB/xvfb-action@v1.0
with:
run: npm test
- name: "(debug) Upload npm log"
if: ${{ !success() }}
uses: actions/upload-artifact@v4
with:
name: "npm-debug-log"
path: "~/.npm/_logs"