diff --git a/.eslintignore b/.eslintignore index a81317d14..f7e4e0b38 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,4 @@ /server /lib /deno-runtime +/.deno diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 403a41004..9ba01c5f6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -10,6 +10,9 @@ on: - 'beta' - 'feat/deno-runtime' +env: + DENO_DIR: .deno + jobs: prepare: runs-on: ubuntu-latest @@ -46,13 +49,18 @@ jobs: id: cache-nodemodules uses: actions/cache@v2 with: - path: ./node_modules - key: ${{ runner.OS }}-node_modules-4-${{ hashFiles('./package-lock.json', '.github/workflows/build_and_test.yml') }} + path: | + ./node_modules + ./deno-runtime/${{ env.DENO_DIR }} + key: ${{ runner.OS }}-node_modules-deno-cache-5-${{ hashFiles('./package-lock.json', './deno-runtime/deno.lock', '.github/workflows/build_and_test.yml') }} - name: npm install if: steps.cache-nodemodules.outputs.cache-hit != 'true' run: npm install + - name: Deno Info + run: npx deno-bin info + - name: Prepare workspace run: | tar czf /tmp/workspace.tar.gz . diff --git a/.gitignore b/.gitignore index 3549bc155..8a8a5c217 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ jspm_packages # Optional npm cache directory .npm +.deno + # Optional REPL history .node_repl_history diff --git a/deno-runtime/deno.jsonc b/deno-runtime/deno.jsonc index 4d1cd79b2..42a21d294 100644 --- a/deno-runtime/deno.jsonc +++ b/deno-runtime/deno.jsonc @@ -7,7 +7,10 @@ "acorn-walk": "npm:acorn-walk@8.2.0", "astring": "npm:astring@1.8.6", "jsonrpc-lite": "npm:jsonrpc-lite@2.2.0", - "uuid": "npm:uuid@8.3.2", "stack-trace": "npm:stack-trace@0.0.10", + "uuid": "npm:uuid@8.3.2" + }, + "tasks": { + "test": "deno test --no-check --allow-read=../" } } diff --git a/package.json b/package.json index 932839cc3..815d3a6b5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "gulp", "test": "concurrently \"npm:test:node\" \"npm:test:deno\"", "lint:eslint": "eslint .", - "lint:deno": "deno lint deno-runtime/", + "lint:deno": "deno lint --ignore=deno-runtime/.deno deno-runtime/", "lint": "concurrently \"npm:lint:eslint\" \"npm:lint:deno\"", "fix-lint": "eslint . --fix", "bundle": "gulp bundle", @@ -17,8 +17,9 @@ "go-publish-beta": "gulp publish-beta", "go-publish-alpha": "gulp publish-alpha", "test:node": "NODE_ENV=test ts-node ./tests/runner.ts", - "test:deno": "cd deno-runtime && deno test --no-check --allow-read", - "gen-doc": "typedoc" + "test:deno": "cd deno-runtime && deno task test", + "gen-doc": "typedoc", + "postinstall": "cd deno-runtime && deno cache main.ts && deno test --no-check --no-run" }, "repository": { "type": "git",