-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
156 lines (132 loc) · 4.5 KB
/
Copy pathTaskfile.yml
File metadata and controls
156 lines (132 loc) · 4.5 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: '3'
tasks:
init:
dir: '{{.ROOT_DIR}}'
cmds:
- pre-commit install --hook-type commit-msg
- pre-commit install
- git submodule update --init --recursive
test:sh:
dir: '{{.ROOT_DIR}}'
env:
CLI_ARGS: '{{.CLI_ARGS}}'
cmd: |
if [ -z "${CLI_ARGS}" ]; then
for test_dir in */test; do
echo "Running tests for ${test_dir}"
echo '---'
test/bats/bin/bats "${test_dir}"
done
exit 0
fi
test/bats/bin/bats "${CLI_ARGS}/test"
test:act:
cmds:
- for:
# actions
- test:act:docker-build
- test:act:changed-files
- test:act:extract-file-from-container
- test:act:deploy
# sample workflows
- test:act:feature-preview
- test:act:staging
- test:act:production
task: "{{ .ITEM }}"
test:act:cleanup:
cmds:
- cmd: docker image rm devops/stub-img
ignore_error: true
test:act:docker-build:
cmds:
- |
act --workflows docker-build/examples/default/workflow.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:feature-preview:
cmds:
- |
act --workflows .github/workflows/feature-preview.yaml \
--eventpath test/stubs/github-events/opened_pull_request.json \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
test:act:staging:
cmds:
- |
act push --workflows .github/workflows/staging.yaml \
--defaultbranch "$(git rev-parse --abbrev-ref HEAD)" \
--eventpath test/stubs/github-events/push_to_main.json \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:production:
cmds:
- |
act push --workflows .github/workflows/production.yaml \
--defaultbranch "$(git rev-parse --abbrev-ref HEAD)" \
--eventpath test/stubs/github-events/push_to_main.json \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:tests:
cmds:
- for:
- test:act:test-sh
- test:act:test-python
task: "{{ .ITEM }}"
test:act:test-sh:
cmds:
- |
act pull_request -j test-sh \
--workflows .github/workflows/test-sh.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
test:act:test-python:
cmds:
- |
act pull_request -j test-python \
--workflows .github/workflows/test-python.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
test:act:changed-files:
cmds:
- |
act --workflows changed-files/examples/force-app-as-changed/workflow.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:extract-file-from-container:
cmds:
- |
act --workflows extract-file-from-container/examples/default/workflow.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:deploy:
cmds:
- |
act --workflows deploy/examples/default/workflow.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:act:jinja2:
cmds:
- |
act --workflows jinja2/examples/default/workflow.yaml \
--container-architecture linux/arm64 \
--secret GITHUB_TOKEN="$(gh auth token)"
- defer: { task: test:act:cleanup }
test:python:release-multiple-to-stg-please-local:
dir: '{{.ROOT_DIR}}'
cmds:
- |
virtualenv release-multiple-to-stg-please/.venv
source release-multiple-to-stg-please/.venv/bin/activate
pip install -r release-multiple-to-stg-please/requirements.txt
PYTHONPATH=release-multiple-to-stg-please/src python -m unittest discover -s release-multiple-to-stg-please/tests
test:python:release-multiple-to-stg-please:
dir: '{{.ROOT_DIR}}'
cmds:
- |
PYTHONPATH=release-multiple-to-stg-please/src python -m unittest discover -s release-multiple-to-stg-please/tests