-
-
Notifications
You must be signed in to change notification settings - Fork 507
69 lines (67 loc) · 3.27 KB
/
main.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
name: Mycodo
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Workaround for https://github.com/actions/runner-images/issues/675
run: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
- name: Install dependencies
run: |
sudo bash mycodo/scripts/upgrade_commands.sh update-apt
sudo apt install -y libatlas-base-dev libboost-python-dev gawk git libffi-dev libi2c-dev nginx python3-dev sqlite3 swig
sudo bash mycodo/scripts/upgrade_commands.sh update-packages
git clone --recursive https://github.com/WiringPi/WiringPi-Python.git && cd WiringPi-Python && git submodule update --init && cd WiringPi && ./build && cd ../..
sudo bash mycodo/scripts/upgrade_commands.sh build-pigpiod
sudo bash mycodo/scripts/upgrade_commands.sh update-influxdb-1
sudo service influxdb start && sleep 3
sudo bash mycodo/scripts/upgrade_commands.sh update-influxdb-1-db-user
sudo useradd -M mycodo
export PATH=/usr/bin:$PATH
- name: Test setup components
run: |
sudo bash mycodo/scripts/upgrade_commands.sh setup-virtualenv
sudo bash mycodo/scripts/upgrade_commands.sh update-pip3
sudo bash mycodo/scripts/upgrade_commands.sh update-pip3-packages
sudo bash mycodo/scripts/upgrade_commands.sh ssl-certs-generate
sudo bash mycodo/scripts/upgrade_commands.sh compile-translations
sudo bash mycodo/scripts/upgrade_commands.sh generate-widget-html
sudo bash mycodo/scripts/generate_translations_pybabel.sh
printf "\n#### Generating Docs\n"
env/bin/python mycodo/scripts/generate_manual_actions.py
env/bin/python mycodo/scripts/generate_manual_functions.py
env/bin/python mycodo/scripts/generate_manual_inputs_by_measure.py
env/bin/python mycodo/scripts/generate_manual_inputs.py
env/bin/python mycodo/scripts/generate_manual_outputs.py
env/bin/python mycodo/scripts/generate_manual_widgets.py
printf "\n#### Generating API Manual\n"
sudo env/bin/python mycodo/start_flask_ui.py &
sleep 10
wget --no-check-certificate -p https://127.0.0.1 -O /dev/null
printf "\n# Installing npm\n"
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update
sudo apt install nodejs
printf "\n# Installing redoc-cli\n"
sudo npm install -g redoc-cli
printf "\n# Generating manual\n"
sudo bash mycodo/scripts/generate_manual_api.sh
- name: Test with pytest
run: |
cd mycodo && ../env/bin/pytest -W ignore::DeprecationWarning -s tests/software_tests