-
Notifications
You must be signed in to change notification settings - Fork 16
180 lines (152 loc) · 5.45 KB
/
ci.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Continuous Integration
on:
push:
branches:
- main
tags:
- '*'
pull_request:
env:
RASA_X_DEMO_VERSION: '0.35.0'
RASA_IMAGE_TAG: '2.2.7-full'
jobs:
test_action_init:
runs-on: ubuntu-latest
name: Test GH action - rasa init
steps:
- uses: actions/checkout@v2
- name: Create a new project
run: |
mkdir rasa-project
chmod 777 rasa-project
docker run --rm -v ${{ github.workspace }}/rasa-project:/rasa-project rasa/rasa:${{ env.RASA_IMAGE_TAG }} init --no-prompt --init-dir /rasa-project
- name: Download Rasa X model
run: |
wget https://github.com/RasaHQ/rasa-x-demo/blob/${{ env.RASA_X_DEMO_VERSION }}/models/model.tar.gz?raw=true \
-O test_model.tar.gz
- id: action
name: Rasa Test & Train - rasa init
uses: ./
with:
rasa_version: ${{ env.RASA_IMAGE_TAG }}
workspace: ${{ github.workspace }}/rasa-project
test_type: all
fine_tune: 'true'
github_token: ${{ secrets.GITHUB_TOKEN }}
configuration_name: 'rasa-init'
publish_summary: 'false'
- name: Checkout output
run: |
echo ${{ fromJSON(steps.action.outputs.report).default['rasa-init'].intent_classification.accuracy }}
- name: Checkout output - if
if: fromJSON(steps.action.outputs.report).default['rasa-init'].intent_classification.accuracy <= 0.5
run: |
echo "::error::${{ fromJSON(steps.action.outputs.report).default['rasa-init'].intent_classification.accuracy }}"
exit 1
# Test the GH action on Rasa X Demo data
# https://github.com/RasaHQ/rasa-x-demo
test_action_x:
runs-on: ubuntu-latest
name: Test GH action - Rasa X Demo
steps:
- uses: actions/checkout@v2
- name: Checkout Rasa X Demo
uses: actions/checkout@v2
with:
repository: RasaHQ/rasa-x-demo
path: rasa-x-demo
ref: ${{ env.RASA_X_DEMO_VERSION }}
- name: Download Rasa X model
run: |
wget https://github.com/RasaHQ/rasa-x-demo/blob/${{ env.RASA_X_DEMO_VERSION }}/models/model.tar.gz?raw=true \
-O test_model.tar.gz
- id: action
name: Rasa Test & Train - Rasa X Demo
uses: ./
with:
rasa_version: ${{ env.RASA_IMAGE_TAG }}
workspace: ${{ github.workspace }}/rasa-x-demo
test_type: all
fine_tune: 'true'
github_token: ${{ secrets.GITHUB_TOKEN }}
model: github_workspace/test_model.tar.gz
configuration: github_workspace/test_files/config_rasa_x_demo.yml
configuration_name: 'Rasa X Demo'
publish_summary: 'false'
data_validate: 'false'
- name: Checkout output
run: |
echo ${{ fromJSON(steps.action.outputs.report).default['Rasa X Demo'].intent_classification.accuracy }}
- name: Checkout output - if
if: fromJSON(steps.action.outputs.report).default['Rasa X Demo'].intent_classification.accuracy <= 0.5
run: |
echo "::error::${{ fromJSON(steps.action.outputs.report).default['Rasa X Demo'].intent_classification.accuracy }}"
exit 1
# Test the GH action on Rasa Demo data
# https://github.com/RasaHQ/rasa-x-demo
# Test type: NLU
test_action:
runs-on: ubuntu-latest
name: Test GH action - Rasa Demo - NLU
needs: [test_action_x]
steps:
- uses: actions/checkout@v2
- name: Checkout Rasa Demo
uses: actions/checkout@v2
with:
repository: RasaHQ/rasa-demo
path: rasa-demo
- name: Use test configuration
run: |
cp .github/test_files/config_rasa_demo.yml rasa-demo/config.yml
- name: Set Rasa Version
run: |
RASA_VERSION=$(sed -ne 's/^rasa==\(.*\)#.*$/\1/p' rasa-demo/requirements.txt)
echo RASA_VERSION=$RASA_VERSION >> $GITHUB_ENV
- id: action
name: Rasa Test & Train - Rasa Demo
uses: ./
with:
rasa_version: ${{ env.RASA_VERSION }}-full
configuration_name: 'Rasa Demo - NLU'
workspace: ${{ github.workspace }}/rasa-demo
test_type: nlu
github_token: ${{ secrets.GITHUB_TOKEN }}
test_nlu_args: '-f 2'
# Use cross validation
cross_validation: 'true'
# Compare results to the test report
compare_report: .github/test_files/report_to_compare.json
# Test the GH action on Rasa Demo data
# https://github.com/RasaHQ/rasa-x-demo
# Test type: ALL
test_action_all:
runs-on: ubuntu-latest
name: Test GH action - Rasa Demo - ALL
steps:
- uses: actions/checkout@v2
- name: Checkout Rasa Demo
uses: actions/checkout@v2
with:
repository: RasaHQ/rasa-demo
path: rasa-demo
- name: Use test configuration
run: |
cp .github/test_files/config_rasa_demo.yml rasa-demo/config.yml
- name: Set Rasa Version
run: |
RASA_VERSION=$(sed -ne 's/^rasa==\(.*\)#.*$/\1/p' rasa-demo/requirements.txt)
echo RASA_VERSION=$RASA_VERSION >> $GITHUB_ENV
- id: action
name: Rasa Test & Train - Rasa Demo
uses: ./
with:
rasa_version: ${{ env.RASA_VERSION }}-full
configuration_name: 'Rasa Demo - ALL'
workspace: ${{ github.workspace }}/rasa-demo
test_type: all
# The arguments algin with the CI in rasa-demo
# https://github.com/RasaHQ/rasa-demo/blob/main/.github/workflows/continuous_integration.yml#L199-L207
test_core_args: >-
--stories tests/test_conversations.yml
github_token: ${{ secrets.GITHUB_TOKEN }}