-
Notifications
You must be signed in to change notification settings - Fork 325
70 lines (56 loc) · 1.6 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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/[email protected]
- 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'
npx vsce package --pre-release --out debug.vsix
- name: Test
uses: GabrielBB/[email protected]
with:
run: npm test
- name: "Rust test"
run: |
cd ./src/zola-slug/
cargo test --release
- name: "(debug) Upload npm log"
if: ${{ !success() }}
uses: actions/upload-artifact@v4
with:
name: "npm-debug-log"
path: "~/.npm/_logs"