-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.project.yml
51 lines (45 loc) · 1.84 KB
/
Taskfile.project.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
---
# https://taskfile.dev
version: '3'
vars:
tasks:
10-RF-test:
desc: "[PROJECT] Robot Framework tests. Arguments: [IMG|I=jfxs/robot-framework:latest] [PULL|P=<n|N>] (*)"
summary: |
[PROJECT] Robot Framework tests.
If robot command is in the path and IMG/I argument is not set, the local robot command is executed,
otherwise an Robot Framework Docker image is used.
Usage: task 00:10-RF-test [IMG|I=<robotframework_image:tag>] [PULL|P=<n|N>]
Arguments:
IMG | I Docker Robot Framework image to use (optional, by default {{.IMAGE_RF}})
PULL | P Pull docker image (optional, by default yes)
vars:
IMAGE_RF: jfxs/robot-framework:latest
IMG: '{{default .I .IMG}}'
IMG_D: '{{default .IMAGE_RF .IMG}}'
PULL: '{{default .P .PULL}}'
EXEC: robot
cmds:
- mkdir -p reports
- |
if (! test -n "{{.IMG}}") && (command -v {{.EXEC}} 2>&1 >/dev/null); then
{{.EXEC}} --outputdir reports tests/RF
else
if [ "{{.PULL}}" != "n" ] && [ "{{.PULL}}" != "N" ]; then docker pull "{{.IMG_D}}"; fi
chmod 777 reports
docker run --user root -t --rm -v $(pwd):/tests "{{.IMG_D}}" /bin/sh -c "apk --no-cache add go-task jq skopeo && {{.EXEC}} -v TASK_BIN:go-task --outputdir /tests/reports /tests/tests/RF"
chmod 755 reports
fi
preconditions:
- sh: command -v docker || command -v robot
msg: "robot-framework or docker are not installed"
silent: true
20-pre-commit:
desc: "[PROJECT] Pre-commit checks."
cmds:
- date > {{.FILE_TASK_START}}
- defer: rm -f {{.FILE_TASK_START}}
- task lint:pre-commit
- task lint:all MEX='"#.cache" "#node_modules" "#.node_cache" "#styles"'
- echo "" && echo "Checks Start $(cat {{.FILE_TASK_START}}) - End $(date)"
silent: true