Repository navigation
Expand file tree
/
Copy pathbitrise.yml
More file actions
104 lines (95 loc) · 3.27 KB
/
Copy pathbitrise.yml
File metadata and controls
104 lines (95 loc) · 3.27 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
format_version: "13"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
include:
- repository: steps-check
branch: master
path: step-metadata.bitrise.yml
- repository: steps-check
branch: master
path: golang.bitrise.yml
app:
envs:
- STEP_VERSION: 2.1.0
# define these in your .bitrise.secrets.yml
- TEST_AUTH_TOKEN: "$TEST_AUTH_TOKEN"
- TEST_REPOSITORY_URL: $TEST_REPOSITORY_URL
- TEST_GIT_COMMIT: $TEST_GIT_COMMIT
- TEST_BUILD_URL: $TEST_BUILD_URL
- STEP_ID_IN_STEPLIB: github-status
workflows:
# ----------------------------------------------------------------
# --- workflow to Step Test
ci:
steps:
- script@1:
title: yamlfmt
inputs:
- content: |-
#!/bin/env bash
set -eo pipefail
set -x
# TODO: deviates from the step-repo convention on purpose. bundle::yamlfmt only
# reformats and leaves autofix-ci to commit the result, which needs Unified CI, so
# here it could never fail. Lint instead until this Step migrates, then switch back.
ymlfmt_conf="$(mktemp)"
curl -sSfL -o "$ymlfmt_conf" https://raw.githubusercontent.com/bitrise-steplib/steps-check/refs/heads/master/.ymlfmt
go run github.com/google/yamlfmt/cmd/yamlfmt@v0.21.0 -lint -conf "$ymlfmt_conf" -match_type doublestar -exclude "_tmp/**,.bitrise.secrets.yml,.git/**,.github/**,vendor/**" '**/*.yml'
- bundle::step-yml-audit: {}
- script@1:
title: Add GOPATH/bin to PATH
inputs:
- content: |-
#!/bin/env bash
set -eo pipefail
# The golangci-lint bundle installs into $(go env GOPATH)/bin and then invokes the
# binary by name. That directory is not on PATH on this stack, where Go is managed
# by asdf, so the bundle fails with "golangci-lint: command not found".
envman add --key PATH --value "$(go env GOPATH)/bin:$PATH"
- bundle::golangci-lint:
inputs:
- golangci_lint_version: 2.11.4
- bundle::go-test: {}
after_run:
- _test_invalid
- _test_success
- _test_failed
- _test_no_commit_hash
_test_success:
steps:
- path::./:
title: Test success status
is_skippable: false
inputs:
- auth_token: "$TEST_AUTH_TOKEN"
- repository_url: "$TEST_REPOSITORY_URL"
- commit_hash: "$TEST_GIT_COMMIT"
- build_url: $TEST_BUILD_URL
- verbose: "yes"
_test_invalid:
steps:
- path::./:
title: Test invalid commit hash
inputs:
- auth_token: "$TEST_AUTH_TOKEN"
- repository_url: "$TEST_REPOSITORY_URL"
- commit_hash: "invalid"
- build_url: $TEST_BUILD_URL
_test_failed:
steps:
- path::./:
title: Test failed status
inputs:
- auth_token: "$TEST_AUTH_TOKEN"
- repository_url: "$TEST_REPOSITORY_URL"
- commit_hash: "$TEST_GIT_COMMIT"
- set_specific_status: failure
- build_url: $TEST_BUILD_URL
_test_no_commit_hash:
steps:
- path::./:
title: Test no commit hash specified
inputs:
- auth_token: "$TEST_AUTH_TOKEN"
- repository_url: "$TEST_REPOSITORY_URL"
- commit_hash:
- build_url: $TEST_BUILD_URL