-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
135 lines (111 loc) · 3.75 KB
/
Taskfile.yaml
File metadata and controls
135 lines (111 loc) · 3.75 KB
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
version: "3"
tasks:
default:
desc: List available tasks
cmds:
- task --list
unit-tests:
desc: Unit tests
cmds:
- cargo test --all-features
automated-tests:
desc: "NOTE: WebDriver on localhost:9515 needs to be running"
cmds:
- cargo test --package fantoccini-tests -- --ignored
ci:
desc: Ci tests
cmds:
- cargo clippy --locked -p vertigo -p vertigo-macro --all-features --tests --target wasm32-unknown-unknown -- -Dwarnings
- cargo clippy --locked -p vertigo-demo -p vertigo-example-counter -p vertigo-example-router -p vertigo-example-trafficlights --all-features --tests --target wasm32-unknown-unknown -- -Dwarnings
- cargo test --locked --all-features
- cargo fmt
# - tests/check_versions.sh
# - tests/js_tests.sh
# - tests/check_vertigo_new.sh
all-tests:
desc: All tests
deps: [unit-tests, automated-tests]
clean:
desc: Demo clean
cmds:
- cargo clean
clean-build:
desc: clean
cmds:
- rm -rf build
clippy-wasm32:
desc: Run clippy for wasm32 target
cmds:
- cargo clippy --all-features --target wasm32-unknown-unknown -p vertigo -p vertigo-macro -p vertigo-demo -p vertigo-example-counter -p vertigo-example-router -p vertigo-example-trafficlights
demo-debug-api:
desc: Demo tasks - debug mode
cmds:
- cargo run --bin vertigo-demo-server
demo-debug-watch:
desc: Demo debug watch
cmds:
- cargo run --bin vertigo -- watch vertigo-demo --dest-dir=demo_build --wasm-run-source-map --env ws_chat=ws://127.0.0.1:3333/ws
demo-watch:
desc: Demo watch
deps: [demo-debug-api, demo-debug-watch]
demo-serve-api:
desc: Demo tasks - release mode
cmds:
- cargo run --bin vertigo-demo-server --release
demo-serve:
desc: Demo serve
cmds:
- cargo run --bin vertigo --release -- build vertigo-demo --dest-dir=demo_build --wasm-run-source-map
- cargo run --bin vertigo --release -- serve --dest-dir=demo_build --env ws_chat=ws://127.0.0.1:3333/ws
demo:
desc: Demo
deps: [demo-serve-api, demo-serve]
examples-counter:
desc: Examples tasks
cmds:
- cargo run --bin vertigo -- watch vertigo-example-counter --dest-dir=examples/build/counter
examples-router:
desc: Examples router
cmds:
- cargo run --bin vertigo -- watch vertigo-example-router --dest-dir=examples/build/router
examples-trafficlights:
desc: Examples trafficlights
cmds:
- cargo run --bin vertigo -- watch vertigo-example-trafficlights --dest-dir=examples/build/trafficlights
js-test:
desc: JavaScript dev build
cmds:
- npm install
- npm run test:hydration
js-build:
desc: Js build
cmds:
- npm install
- npx rollup -c
lint:
desc: Lint
cmds:
- cargo run --bin lint-project
git-branch-rebase-and-push:
desc: Rebase current branch on master, squash to one commit, and force push
cmds:
- cargo fmt
- task ci
- |
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" = "master" ]; then
echo "Error: You are on the 'master' branch. This task is for feature branches only."
exit 1
fi
git fetch origin master
git rebase origin/master
# Find the first commit of this branch since origin/master
FIRST_COMMIT=$(git rev-list --reverse origin/master..HEAD | head -n 1)
if [ -z "$FIRST_COMMIT" ]; then
echo "No commits to squash."
exit 0
fi
# Squash everything into one commit using the first commit's identity
git reset --soft origin/master
git commit -C "$FIRST_COMMIT"
git push origin "$CURRENT_BRANCH" --force