-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
186 lines (156 loc) · 3.6 KB
/
Taskfile.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# https://taskfile.dev
version: "3"
tasks:
default:
- task: help
routes:
desc: Prints backend http routes
cmds:
- mix phx.routes -r Chat.Router
reset:
desc: Restarts development environment
cmds:
- task: clean
- task: setup
clean:
desc: Restarts development environment
deps: [compose.up]
cmds:
- mix clean
- mix ecto.drop
- rm -rf ./assets/node_modules
- rm -rf ./uploads
- rm .env
- task: compose.down
format:
desc: Formats elixir code
cmds:
- mix format
migrate:
desc: Runs database migrations
deps: [compose.up]
cmds:
- mix ecto.migrate
server:
desc: Starts backend for development environment
deps: [migrate]
cmds:
- mix phx.server
iex.server:
desc: Starts backend server on interactive mode
deps: [migrate]
cmds:
- iex -S mix phx.server
iex:
desc: Starts interactive elixir session
deps: [migrate]
cmds:
- iex -S mix
compose.logs:
desc: Shows logs from the containers
cmds:
- docker-compose logs --tail=5 -f
compose.up:
desc: Starts docker images
cmds:
- docker-compose up -d
- docker-compose ps
compose.down:
desc: Stops docker images
cmds:
- docker-compose down -v
setup.frontend:
desc: Installs node_modules
dir: ./assets
cmds:
- npm install
setup:
desc: |
Setups the project by installing node_modules, elixir deps, running the database and
seeding some test data
deps: [compose.up]
cmds:
- cp .env.template .env
- task: setup.frontend
- mix deps.get
- mix compile
- mix ecto.setup
status:
- test -d ./assets/node_modules
- test -d ./_build
seed:
desc: Seeds database with testing data
cmds:
- mix run priv/repo/seeds.exs
react.devtools:
desc: Starts native react devtools
dir: ./assets
cmds:
- npx react-devtools
test.backend:
desc: Run tests for backend
deps: [compose.up]
cmds:
- mix test
test.backend.wip:
desc: Run work in progress tagged tests for backend
deps: [compose.up]
cmds:
- mix test --only wip
test.frontend:
desc: Runs tests for frontend
dir: ./assets
cmds:
- npm test
test.frontend.watch:
desc: Runs tests in watch mode
dir: ./assets
cmds:
- npm run test.watch
test:
desc: Runs all tests both backend and frontend
cmds:
- task: test.backend
- task: test.frontend
help:
- cmd: echo "This is the cli tool for managing the project"
silent: true
act:
desc: Runs all github-actions jobs locally
cmds:
- act
act.test.backend:
desc: Runs backend github-actions job locally
cmds:
- act -j backend
act.test.frontend:
desc: Runs backend github-actions job locally
cmds:
- act -j frontend
ci.test.backend:
desc: Runs backend tests in ci
cmds:
- mix test
ci.test.frontend:
desc: Runs frontend tests in ci
dir: ./assets
cmds:
- npm test
ci.format:
desc: Runs formatting checking for elixir
cmds:
- mix format --check-formatted
ci.dialyzer:
desc: Runs Dialyzer for elixir
cmds:
- mkdir -p priv/plts
- mix dialyzer --quiet
ci.setup:
desc: |
Setups the project by installing node_modules, elixir deps and
running the database some test data in github-actions
cmds:
- cp .env.template .env
- mix deps.get
- mix compile
- npm --prefix ./assets ci --progress=false --no-audit --loglevel=error