-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile.toml
149 lines (126 loc) · 3.09 KB
/
Makefile.toml
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
[env] ## tells cargo make that we're in the context of a Cargo workspace
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
[config] ## we want most/all of our tasks to run in the context of a workspace
default_to_workspace = false
[tasks.dev]
install_crate="cargo-watch"
cwd = "./crates/conduit-bin"
command = "cargo"
args = ["watch", "-x", "clippy", "-x", "run"]
dependencies = ["postgres"]
[tasks.web]
command = "trunk"
args = ["serve"]
dependencies = ["docker-start"]
[tasks.web-demo]
command = "trunk"
args = ["serve"]
[tasks.docker]
command = "docker"
args = [
"compose",
"-f", "./deploy/docker-compose.metrics.yml",
"-f", "./deploy/docker-compose.postgres.yml",
"-f", "./deploy/docker-compose.conduit-bin.yml",
"-f", "./deploy/docker-compose.conduit-web.yml",
"up",
"--build"
]
[tasks.docker-start]
command = "docker"
args = [
"compose",
"-f", "./deploy/docker-compose.metrics.yml",
"-f", "./deploy/docker-compose.postgres.yml",
"-f", "./deploy/docker-compose.conduit-bin.yml",
"start"
]
[tasks.postgres]
command = "docker"
args = [
"compose",
"-f", "./deploy/docker-compose.metrics.yml",
"-f", "./deploy/docker-compose.postgres.yml",
"start"
]
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[tasks.fix]
command = "cargo"
args = ["fix", "--allow-dirty"]
[tasks.lint]
command = "cargo"
args = ["clippy"]
[tasks.lint-staged]
command = "npx"
args = ["lint-staged"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.build]
command = "cargo"
args = ["build", "--release"]
[tasks.test]
command = "cargo"
args = ["test"]
[tasks.test-watch]
install_crate = "cargo-watch"
command = "cargo"
args = ["watch", "-x", "test"]
[tasks.test-commit]
command = "cargo"
args = ["test"]
[tasks.local-coverage]
install_crate = "cargo-tarpaulin"
command = "cargo"
args = [
"tarpaulin",
"--verbose",
"--all-features",
"--workspace",
"--timeout",
"240",
"--out",
"Xml"
]
[tasks.integration]
command = "./integrations/run-postman-tests.sh"
dependencies = ["docker-start"]
[tasks.migrate] ## ensure Postgres is running, the container has a bit of warmup time causing migrations to fail
cwd = "./crates/conduit-infrastructure"
install_crate = "sqlx"
command = "sqlx"
args = ["migrate", "run"]
dependencies = ["postgres"]
[tasks.refresh-schema]
cwd = "./crates/conduit-infrastructure"
install_crate = "sqlx"
command = "cargo"
args = ["sqlx", "prepare"]
[tasks.pre-commit]
dependencies = [
"lint", ## lints our code using clippy during pre-commit
"lint-staged", ## uses cargofmt to format our staged files
]
# ci task is called from our CI GitHub action
[tasks.ci]
dependencies = [
"build",
"test"
]
# coverage task is called from our coverage GitHub action
[tasks.ci-coverage]
toolchain = "nightly"
command = "cargo"
args = [
"tarpaulin",
"--verbose",
"--all-features",
"--workspace",
"--timeout",
"240",
"--out",
"Xml"
]