-
Notifications
You must be signed in to change notification settings - Fork 0
/
qad.yml.dist
44 lines (44 loc) · 1.5 KB
/
qad.yml.dist
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
version: "1.0"
jobs:
"image-build":
script: [ "docker build --pull cicd -t rustlang/rust:nightly-local" ]
skip_if: "docker images --format '{{.Repository}}:{{.Tag}}' | grep 'rustlang/rust:nightly-local'"
group: build
fmt:
script: [ cargo fmt ]
image: rustlang/rust:nightly-local
group: fmt
clippy:
script: [ cargo clippy --tests --color always --all-features ]
image: rustlang/rust:nightly-local
group: test
skip_if: test $HAS_RUST != true
tests:
script: [ cargo test --color always --all-features ]
image: rustlang/rust:nightly-local
group: test
skip_if: test $HAS_RUST != true
unit:
script: [ ./tools/bash-unit-tests.sh ]
group: test
skip_if: test $HAS_BASH != true
env:
script: [ printf "%s\n" "CHANGED_FILES=$CHANGED_FILES" "HAS_RUST=$HAS_RUST" "HAS_BASH=$HAS_BASH" ]
group: skip
groups:
- build
- fmt
- test
display:
mode: sequence
ok: "\e[32m✔\e[0m"
ko: "\e[31m✕\e[0m"
cancelled: "\e[35m✕\e[0m"
spinner:
frames: [ "⣇", "⣦", "⣴", "⣸", "⢹", "⠻", "⠟", "⡏" ]
per_frames: 70
env: |
LAST_COMMON_COMMIT=$(git merge-base "origin/main" "$(git branch --show-current)")
CHANGED_FILES=$(cat <(git diff --name-only --diff-filter=DRAM "$LAST_COMMON_COMMIT") <(git ls-files -o --exclude-standard))
HAS_RUST=$(awk '/.rs$/ { rc=1 } END { if (rc) print "true"; else print "false"; }' <<<$CHANGED_FILES)
HAS_BASH=$(awk '/.sh$/ { rc=1 } END { if (rc) print "true"; else print "false"; }' <<<$CHANGED_FILES)