adds a CI

This commit is contained in:
damirka 2021-09-23 18:59:36 +03:00
parent 1ffcede96c
commit 5d7fea6215
4 changed files with 51 additions and 4 deletions

48
.github/workflows/wasm.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: CI
on:
pull_request:
push:
branches:
- master
- staging
- trying
paths-ignore:
- 'docs/**'
- 'documentation/**'
env:
RUST_BACKTRACE: 1
jobs:
test-wasm-parser:
name: Test Package ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: wasm
strategy:
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
include:
- os: ubuntu-latest
sccache-path: /home/runner/.cache/sccache
- os: macos-latest
sccache-path: /Users/runner/Library/Caches/Mozilla.sccache
- os: windows-latest
sccache-path: "C:\\Users\\runneradmin\\AppData\\Local\\Mozilla\\sccache"
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ matrix.sccache-path }}
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install wasm-pack
run: npm install -g wasm-pack
- name: Run wasm-pack
run: wasm-pack build --dev --target nodejs
- name: Install dependencies and run tests
run: cd tests && npm ci && npm test

View File

@ -1,2 +1 @@
node_modules node_modules
dist

View File

@ -2,9 +2,10 @@
"name": "parser-wasm-tests", "name": "parser-wasm-tests",
"version": "0.1.0", "version": "0.1.0",
"description": "Test Framework implementation for compiler tests in WASM", "description": "Test Framework implementation for compiler tests in WASM",
"main": "index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"compile": "tsc -p ./" "compile": "tsc -p ./",
"test": "npm run compile && node dist/index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -18,7 +18,6 @@ import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as parser from '../../pkg/leo_wasm'; import * as parser from '../../pkg/leo_wasm';
import * as yaml from 'js-yaml'; import * as yaml from 'js-yaml';
import {JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA} from 'js-yaml';
// Path to the parser tests folder // Path to the parser tests folder
const TESTS_PATH: string = path.join(__dirname, '../../../tests/parser'); const TESTS_PATH: string = path.join(__dirname, '../../../tests/parser');