-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
81 lines (75 loc) · 2.34 KB
/
action.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
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
name: 'assay-it'
description: 'Test Cloud Apps in Production. Confirm Quality & Eliminate Risk with https://assay.it'
inputs:
version:
description: |
The version of assay-it to use.
required: true
default: "1.2.0"
install-go:
description: |
Golang is required for running assay-it.
If set to false, the action expects you to have installed Go already.
required: true
default: true
working-directory:
description: |
Path to the working directory assay-it should be executed in.
If skipped, the action uses $GITHUB_WORKSPACE.
This is useful when dealing with multiple projects within one repository.
required: false
default: ""
system-under-test:
description: |
Url of target system to execute a quality checks.
It shall start with protocol scheme (e.g. https://assay.it)
required: true
force-command:
description: |
assay-it uses either 'test' command for quality checks of golang modules
or uses 'eval' command for other runtime. It automatically detects the
mode depending on the project runtime. The option force the command
required: false
default: ""
verbose:
description: |
Verbose output of unit tests
required: false
default: false
runs:
using: "composite"
steps:
- id: install_go
if: ${{ inputs.install-go != 'false' }}
uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: "1.20.x"
- env:
version: ${{ inputs.version }}
sut: ${{ inputs.system-under-test }}
verbose: ${{ inputs.verbose }}
command: ${{ inputs.force-command }}
working-directory: ${{ inputs.working-directory }}
run: |
curl -s -L -o $(go env GOPATH)/bin/assay-it https://github.com/assay-it/assay-it/releases/download/v${version}/assay-it_${version}_linux_amd64
chmod +x $(go env GOPATH)/bin/assay-it
$(go env GOPATH)/bin/assay-it -v
opts=()
if [[ -z ${command} ]];
then
if [[ -f "go.mod" ]];
then
opts+=(test)
else
opts+=(eval)
fi
else
opts+=(${command})
fi
opts+=(-t ${sut})
if [[ "${verbose}" == "true" ]];
then
opts+=(-v)
fi
$(go env GOPATH)/bin/assay-it "${opts[@]}"
shell: bash