[91d3fd]: / .github / workflows / rasa-test.yml

Download this file

80 lines (67 with data), 2.7 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
name: Chatbot Unit testing
# Only trigger the workflow in the case of a version tag pushed
on:
push:
tags:
- "v*.*.*"
# branches:
# - 'rasa'
# pull_request:
# branches:
# - 'rasa'
# Workflow can be run manually with REST API and 'ref' as request body parameters.
# The reference should be tag name,
# Reference: https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event
workflow_dispatch:
jobs:
build:
name: Run Unittests on the chatbot
# Builds run on latest Ubuntu instance
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so the job can access it
# We don't use 're: rasa' in this step, refs should be the tags
- name: Check Out Repo
uses: actions/checkout@v2
# Store the github repository tag
- uses: actions/checkout@v2
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# Set python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install chatbot dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f ./production/rasa-server/requirements.txt ]; then pip install -r ./production/rasa-server/requirements.txt; fi
# Download chatbot weights
- name: Download model weights
run: |
mkdir ./production/rasa-server/rasa/models/
wget -q ftps://nabot.ml/medbot_weights/${{ steps.vars.outputs.tag }}.tar.gz \
-P ./production/rasa-server/rasa/models/
# Download and extract ConveRT weights
- name: Download ConveRT weights
run: |
mkdir -p ./production/rasa-server/rasa/weights/model
wget -q https://github.com/connorbrinton/polyai-models/releases/download/v1.0/model.tar.gz \
-P ./production/rasa-server/rasa/weights/
tar -xvzf ./production/rasa-server/rasa/weights/model.tar.gz \
-C ./production/rasa-server/rasa/weights/model
rm ./production/rasa-server/rasa/weights/model.tar.gz
# Copy domain and weight files to the test directory
- name: Copy domain.yml file and convert weights
run: |
cp ./production/rasa-server/rasa/domain.yml .
cp -r ./production/rasa-server/rasa/weights .
# Run test units
- name: Test with unittest
run: |
python ./development/testcase/simple_test.py