Skip to content

Commit 6570d6a

Browse files
authored
Merge pull request #33 from vim-denops/tools
☕ Add `Makefile` as a task runner
2 parents a453c2b + bfc987e commit 6570d6a

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ on:
1010
push:
1111
branches:
1212
- main
13+
paths:
14+
- "**/*.md"
15+
- "**/*.ts"
16+
- ".github/workflows/test.yml"
1317
pull_request:
1418
branches:
1519
- main
20+
paths:
21+
- "**/*.md"
22+
- "**/*.ts"
23+
- ".github/workflows/test.yml"
1624

1725
jobs:
1826
typecheck:
@@ -24,8 +32,7 @@ jobs:
2432
with:
2533
deno-version: ${{ env.DENO_VERSION }}
2634
- name: Type check
27-
run: |
28-
deno test --unstable --no-run ./**/*.ts
35+
run: make type-check
2936

3037
lint:
3138
runs-on: ubuntu-20.04
@@ -36,7 +43,7 @@ jobs:
3643
with:
3744
deno-version: ${{ env.DENO_VERSION }}
3845
- name: Lint
39-
run: deno lint
46+
run: make lint
4047

4148
format:
4249
runs-on: ubuntu-20.04
@@ -47,8 +54,7 @@ jobs:
4754
with:
4855
deno-version: ${{ env.DENO_VERSION }}
4956
- name: Format
50-
run: |
51-
deno fmt --check
57+
run: make fmt-check
5258

5359
test:
5460
runs-on: ubuntu-20.04
@@ -90,8 +96,7 @@ jobs:
9096
env:
9197
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
9298
- name: Test
93-
run: |
94-
deno test --unstable -A
99+
run: make test
95100
env:
96101
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
97102
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.tools

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DEFAULT_GOAL := help
2+
3+
help:
4+
@cat $(MAKEFILE_LIST) | \
5+
perl -ne 'print if /^\w+.*##/;' | \
6+
perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'
7+
8+
fmt: FORCE ## Format code
9+
@deno fmt
10+
11+
fmt-check: FORCE ## Format check
12+
@deno fmt --check
13+
14+
lint: FORCE ## Lint code
15+
@deno lint
16+
17+
type-check: FORCE ## Type check
18+
@deno test --unstable --no-run **/*.ts
19+
20+
test: FORCE ## Test
21+
@deno test --unstable -A
22+
23+
FORCE:

0 commit comments

Comments
 (0)