This repository was archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
155 lines (148 loc) · 6.27 KB
/
test-credential-commands.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
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
name: Test Credential Commands
# TXT files used for ASSERT are located on the /testdata/gha_workflows directory.
# To help you coding your workflow tests, you can use CAT commands to show each file you will compare on the workflow window on Github.
# EXAMPLE:
# rit list credential > check1.txt
# cat check1.txt
# cat testdata/gha_workflows/credential_workflow/assert1.txt
# diff check1.txt testdata/gha_workflows/credential_workflow/assert1.txt
on:
workflow_dispatch: # Can be triggered manually through the ACTIONS tab on Github GUI.
push:
paths: # Will trigger on PUSH event that update at least one of those files.
- '**/cmd.go'
- '**/delete_test.go'
- '**/delete.go'
- '**/delete_credential_test.go'
- '**/delete_credential.go'
- '**/list_credential_test.go'
- '**/list_credential.go'
- '**/list_test.go'
- '**/list.go'
- '**/set_credential_test.go'
- '**/set_credential.go'
- '**/set_test.go'
- '**/set.go'
- 'testdata/gha_workflows/credential_workflow/**'
- '**/test-credential-commands.yml'
pull_request:
paths: # Will trigger on PULL_REQUEST event that update at least one of those files.
- '**/cmd.go'
- '**/delete_test.go'
- '**/delete.go'
- '**/delete_credential_test.go'
- '**/delete_credential.go'
- '**/list_credential_test.go'
- '**/list_credential.go'
- '**/list_test.go'
- '**/list.go'
- '**/set_credential_test.go'
- '**/set_credential.go'
- '**/set_test.go'
- '**/set.go'
- 'testdata/gha_workflows/credential_workflow/**'
- '**/test-credential-commands.yml'
jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-linux && sudo mv ./dist/linux/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: rit set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: rit delete credential --provider=github
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-mac && sudo mv ./dist/darwin/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: rit set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: rit delete credential --provider=github
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
choco install make
make build-windows && move D:\a\ritchie-cli\ritchie-cli\dist\windows\rit.exe "D:\a\ritchie-cli\ritchie-cli"
ls
.\rit.exe init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: ./rit.exe set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: ./rit.exe delete credential --provider=github
- name: RIT LIST CREDENTIAL command (3)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED