-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.watch.yaml
123 lines (116 loc) · 3.21 KB
/
.watch.yaml
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
## Funzzy events file
# more details see: https://github.com/cristianoliveira/funzzy
#
# list here all the events and the commands that it should execute
#
# HOWTO: use in a workflow
#
# My current workflow is very simple I start by spining up funzzy and
# then start making my changes, everytime all the tests pass the changed file
# is staged to git. Once I'm done with my changes I simply commit. :)
#
# Run all tasks with `fzz -nb`
# Run quick tasks with `fzz -nbt @quick`
#
- name: start by updating deps @quick
run: cargo update
run_on_init: true
- name: run my build
run: "make build"
change: ["Cargo.*"]
- name: run lint and formatter @quick
run:
- cargo fmt -- --check {{filepath}}
- cargo fmt
run_on_init: true
change:
- "src/**"
- "tests/**"
ignore:
- "src/**/*log*"
- "examples/*.yml"
- "examples/*.yaml"
- "examples/workdir/**"
- name: run my test @quick
run: |
cat .github/workflows/on-push.yml \
| yq '.jobs | .[] | .steps | .[] | .run | select(. != null)' \
| xargs -I {} bash -c {}
change:
- "src/**"
- "tests/**/*.rs"
run_on_init: true
# Moved integration to earlier because it is faster than @nixbuild
- name: run integration
run:
# NOTE: Create setup for running the integration tests
# For integration tests we use some temporary files to check triggers
# See: tests/watching_configured_rules.rs
- rm -rf /tmp/fzz
- mkdir /tmp/fzz
# Filter with `INTEGRATION_TEST=watching_configured_rules fzz -t integration`
# if fails open nvim with the failing logs
- "cargo test --test ${INTEGRATION_TEST:-'*'} -- --nocapture"
- rm -rf /tmp/fzz
change:
- "src/**"
- "tests/**/*.rs"
- "examples/*.yaml"
- "examples/*.yml"
ignore:
- "examples/reload-config-example.yml"
- "examples/workdir/**"
- "**/*.log"
run_on_init: true
- name: nix checks @nixbuild
run:
- rm -rf /tmp/fzz
# This avoids running integration test if the pckg is not even buildin
- cargo build --release
# Build and run integration tests
- make nix-flake-check
- make nix-build-nightly
- rm -rf /tmp/fzz
change:
# Uncomment these for when having to debug issues with nix builds
# when you want to run commands in the integration tests to debug
# directories or the environment where the build is happening
#
# Eg running
# ```rust
# shell!("ls -la");
# ```
# See: tests/common/macros.rs
# And the usage in: tests/common/lib.rs
#
# To debug use `fzz -nt @nixbuild`
#
# IN NIGHTLY VERSION `fzz -nbt @nixbuild`
# which bails fast
# - "src/**"
- "tests/**"
- "**/*.nix"
run_on_init: true
- name: after all checks if no error stage to git @quick @nixbuild
run:
- 'git add $(echo "{{filepath}}" | sed "s#$PWD/##")'
- 'git add . -p'
# - 'git commit'
change:
- ".watch.yaml"
- "README.md"
- "src/**"
- "tests/**"
- "examples/*.yml"
- "examples/*.yaml"
- "**/*.nix"
ignore:
- "examples/workdir/**"
- "examples/reload-config-example.yml"
run_on_init: true
- name: after commit attempt to rebase
run:
- git fetch --all
- git rebase origin/master
change:
- ".git/COMMIT_EDITMSG"