From bbeae182c7290a6d377c63194b88e5d1acfb856a Mon Sep 17 00:00:00 2001 From: Yuki Tanaka Date: Mon, 21 Mar 2022 21:14:24 +0900 Subject: [PATCH] ci: Use `deno task` (#297) --- .github/workflows/build.yml | 11 +++++------ deno.json | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 deno.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1176359c..af0c1caf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,14 +34,14 @@ jobs: - name: Check mod.ts run: | - deno run --allow-read --allow-write --allow-run tools/make_mod.ts + deno task make_mod git diff --exit-code deno cache mod.ts # Ensure that mod.ts works without --unstable - name: Run lint run: | - deno fmt --check --ignore=./benchmark/node_modules - deno lint --ignore=./benchmark/node_modules + deno fmt --check + deno lint - name: Set up Redis ${{ matrix.redis }} uses: shogo82148/actions-setup-redis@v1 @@ -51,11 +51,10 @@ jobs: - name: Run tests run: | - deno test --allow-net --allow-read=tests --allow-write=tests/tmp --allow-run=redis-server,redis-cli ./tests + deno task test - name: Run doc tests run: | - deno test --doc --no-run --import-map=import_map.test.json - + deno task test:doc - uses: bahmutov/npm-install@v1 with: working-directory: benchmark diff --git a/deno.json b/deno.json new file mode 100644 index 00000000..d5900261 --- /dev/null +++ b/deno.json @@ -0,0 +1,21 @@ +{ + "fmt": { + "files": { + "exclude": [ + "benchmark/node_modules" + ] + } + }, + "lint": { + "files": { + "exclude": [ + "benchmark/node_modules" + ] + } + }, + "tasks": { + "test": "deno test --allow-net --allow-read=tests --allow-write=tests/tmp --allow-run=redis-server,redis-cli ./tests", + "test:doc": "deno test --doc --no-run --import-map=import_map.test.json", + "make_mod": "deno run --allow-read --allow-write --allow-run tools/make_mod.ts" + } +}