-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (55 loc) · 2.1 KB
/
controller-ci.yaml
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: Controller and Firmware tests CI
on:
push:
paths:
- 'firmware/**'
- 'controller/**'
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
environment: general
env:
ESP_CONTROLLER_SERVER_PORT: ${{ vars.ESP_CONTROLLER_SERVER_PORT }}
ESP_CONTROLLER_SERVER_HOST: ${{ vars.ESP_CONTROLLER_SERVER_HOST }}
ESP_WIFI_SSID: ${{ vars.ESP_WIFI_SSID }}
ESP_WIFI_PASSWORD: ${{ vars.ESP_WIFI_PASSWORD }}
CONTROLLER_WEBSOCKET_PORT: ${{ vars.CONTROLLER_WEBSOCKET_PORT }}
CONTROLLER_SERVER_PORT: ${{ vars.CONTROLLER_SERVER_PORT }}
BACKEND_HTTP_PORT: ${{ vars.BACKEND_HTTP_PORT }}
CONTROLLER_PDM_PUBLISH_PASSWORD: ${{ secrets.CONTROLLER_PDM_PUBLISH_PASSWORD }}
CONTROLLER_PDM_PUBLISH_USERNAME: ${{ secrets.CONTROLLER_PDM_PUBLISH_USERNAME }}
CONTROLLER_PDM_OVERRIDE_VERSION: 'none'
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set Env File
run: printenv | grep -v "^\(PWD\|SHLVL\|HOME\)" > .env
- name: Install toml
run: pip install toml
- name: Build Controller Container
run: |
./ribot.py build --container controller
- name: Build Firmware Container
run: |
./ribot.py build --container firmware
- name: Lint Controller
run: ./ribot.py lint --container controller
- name: Run Firmware and Controller Tests
run: ./ribot.py test
- name: Publish Controller Package
if: github.ref == 'refs/heads/main'
run: ./ribot.py publish-controller
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Controller Container
if: github.ref == 'refs/heads/main'
run: ./ribot.py docker-compose --container controller --op push
- name: Stop and remove containers
if: always()
run: |
./ribot.py down --container controller
./ribot.py down --container firmware