-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathTaskfile.yml
More file actions
122 lines (102 loc) · 2.74 KB
/
Taskfile.yml
File metadata and controls
122 lines (102 loc) · 2.74 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
version: '3'
vars:
BUCKET: "circleci-docs-platform-assets"
RESULTS_DIR: test-reports
TEST_REPORT: test-reports/tests.xml
LINT_REPORT: test-reports/lint.xml
tasks:
lint:
desc: Run `golangci-lint run` to lint the code
summary: Lint the project with golangci-lint
vars:
ARGS: '{{default "./..." .CLI_ARGS}}'
cmds:
- go tool golangci-lint run {{.ARGS}}
lint-migrate:
desc: Migrate the `golangci-lint` config
cmds:
- go tool golangci-lint migrate
fmt:
desc: Format the code
vars:
ARGS: '{{default "." .CLI_ARGS}}'
cmds:
- go tool gosimports -local "$(go list -m)" -w {{.ARGS}}
test:
desc: Run the tests
vars:
ARGS: '{{default "./..." .CLI_ARGS}}'
cmds:
- mkdir -p {{.RESULTS_DIR}}
- go tool gotestsum -- -race {{.ARGS}}
generate:
desc: Run generation of any generated code
vars:
ARGS: '{{default "./..." .CLI_ARGS}}'
cmds:
- go generate -x {{.ARGS}}
mod-tidy:
desc: Run 'go mod tidy' to clean up module files.
cmds:
- go mod tidy -v
mod-download:
desc: Run 'go mod download' to retrieve module files.
cmds:
- go mod download -x
deploy:
desc: Deploy to S3 bucket
cmds:
- dir=$(mktemp -d);
cp -r "./build" "${dir}/docs";
aws s3 sync "${dir}" "s3://{{.BUCKET}}/" --delete;
rm -rf "${dir}";
deploy-redirects:
desc: Build main
cmds:
- go run ./cmd/create-redirects {{.BUCKET}}
validate-redirects:
desc: Build main
cmds:
- go run ./cmd/validate-redirects https://circleci.com
build:
desc: Build docs
cmds:
- npm run build:docs
validate-html:
desc: Validate HTML, links, etc
cmds:
- go tool htmltest
# Tasks for running the service locally
run-publicapi:
desc: Run the public API
cmds:
- go run ./cmd/publicapi
run-internalapi:
desc: Run the internal API
cmds:
- go run ./cmd/internalapi
# Tasks below here are intended mainly to be run as part of CI
ci:lint:
desc: Run `golangci-lint run` to lint the code, outputting a report.
cmds:
- mkdir -p "{{.RESULTS_DIR}}"
- task: lint
vars:
CLI_ARGS: |
./... \
--output.junit-xml.path "{{.LINT_REPORT}}" --output.junit-xml.extended \
--output.text.path=stdout --output.text.colors=true
ci:test:
desc: Run the tests and output the test results
vars:
ARGS: '{{default "./..." .CLI_ARGS}}'
cmds:
- mkdir -p {{.RESULTS_DIR}}
- go tool gotestsum --junitfile="{{.TEST_REPORT}}" -- -race -count=1 {{.ARGS}}
ci:diff:
desc: Check no diffs
cmds:
- task: generate
- task: fmt
- task: mod-tidy
- git diff --exit-code