Skip to content

Commit 1b5a0b3

Browse files
authored
Merge pull request #179 from HyperloopUPV-H8/develop
Backend V2.0.0-beta
2 parents caa0310 + af3fe89 commit 1b5a0b3

313 files changed

Lines changed: 5752 additions & 8447 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-backend.yaml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
name: Build backend
22

33
on:
4-
workflow_call:
5-
secrets:
6-
SECRET:
7-
required: true
84
workflow_dispatch:
95
pull_request:
106
paths:
117
- backend/**
128

13-
env:
14-
SECRET: ${{ secrets.SECRET }}
15-
169
jobs:
1710
build-backend-linux:
1811
name: "Build backend for linux"
1912
runs-on: ubuntu-latest
2013

21-
# Runs on alpine because it is easier to staticly link the library
14+
# Runs on alpine because it is easier to statically link the library
2215
container:
2316
image: golang:alpine
2417

@@ -37,11 +30,6 @@ jobs:
3730
working-directory: "${{env.BACKEND_DIR}}"
3831
run: mkdir ./output
3932

40-
- name: "Load secret"
41-
working-directory: "${{env.BACKEND_DIR}}"
42-
run: |
43-
./load-secret.sh "$SECRET"
44-
4533
- name: "Build (64 bit)"
4634
working-directory: "${{env.BACKEND_DIR}}/cmd"
4735
env:
@@ -75,14 +63,6 @@ jobs:
7563
go-version: "1.21.3"
7664
cache-dependency-path: "${{env.BACKEND_DIR}}\\go.sum"
7765

78-
- name: "Load secret"
79-
working-directory: "${{env.BACKEND_DIR}}"
80-
run: |
81-
echo "$env:SECRET" > ".\internal\excel\secret.json"
82-
echo "$env:SECRET" > ".\internal\excel_adapter\internals\secret.json"
83-
echo "$env:SECRET" > ".\pkg\excel\secret.json"
84-
echo "$env:SECRET" > ".\pkg\excel_adapter\internals\secret.json"
85-
8666
- name: "Create output path"
8767
working-directory: "${{env.BACKEND_DIR}}"
8868
run: mkdir .\output
@@ -127,11 +107,6 @@ jobs:
127107
working-directory: "${{env.BACKEND_DIR}}"
128108
run: mkdir ./output
129109

130-
- name: "Load secret"
131-
working-directory: "${{env.BACKEND_DIR}}"
132-
run: |
133-
./load-secret.sh "$SECRET"
134-
135110
- name: "Build (64 bit)"
136111
working-directory: "${{env.BACKEND_DIR}}/cmd"
137112
env:
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build control station
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- control-station/**
8+
- common-front/**
9+
10+
jobs:
11+
build-control-station:
12+
name: 'Build control station'
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
FRONTEND_DIR: ./control-station
17+
COMMON_DIR: ./common-front
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
sparse-checkout: |
23+
control-station
24+
common-front
25+
26+
- name: 'Install common front dependencies'
27+
working-directory: '${{env.COMMON_DIR}}'
28+
run: npm install
29+
30+
- name: 'Build common front'
31+
working-directory: '${{env.COMMON_DIR}}'
32+
run: npm run build
33+
34+
- name: 'Install control station dependencies'
35+
working-directory: '${{env.FRONTEND_DIR}}'
36+
run: npm install
37+
38+
- name: 'Build control station'
39+
working-directory: '${{env.FRONTEND_DIR}}'
40+
run: npm run build
41+
42+
- name: 'Upload build'
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: control-station
46+
path: '${{env.FRONTEND_DIR}}/static/*'
47+
retention-days: 3
48+
compression-level: 9

.github/workflows/build-ethernet-view.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Build ethernet view
22

33
on:
4-
workflow_call:
54
workflow_dispatch:
65
pull_request:
76
paths:

.github/workflows/test-backend.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- backend/**
1010
workflow_dispatch:
1111

12-
env:
13-
SECRET: ${{ secrets.SECRET }}
14-
1512
jobs:
1613
test-backend:
1714
name: "Test backend"
@@ -35,11 +32,6 @@ jobs:
3532
run: |
3633
sudo apt-get update && sudo apt-get install -y libpcap-dev
3734
38-
- name: "Load secret"
39-
working-directory: "${{env.BACKEND_DIR}}"
40-
run: |
41-
./load-secret.sh "$SECRET"
42-
4335
- name: Test with Go
4436
working-directory: "${{env.BACKEND_DIR}}"
4537
run: go test -v -timeout 30s ./...

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
build
22
profiles
33

4-
# GOOGLE API KEY
5-
secret.json
4+
# ADJ
5+
JSON_ADE
66

77
# MacOS Files
88
.DS_Store

backend/cmd/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package main
22

33
import (
4-
"github.com/HyperloopUPV-H8/h9-backend/internal/excel_adapter"
54
"github.com/HyperloopUPV-H8/h9-backend/internal/server"
65
"github.com/HyperloopUPV-H8/h9-backend/internal/vehicle"
76
)
87

98
type Config struct {
10-
Excel excel_adapter.ExcelAdapterConfig
119
Vehicle vehicle.Config
1210
Server server.Config
1311
}

backend/cmd/config.toml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,4 @@ connections = "/backend"
1111
files = "/"
1212

1313
[vehicle]
14-
boards = ["VCU"]
15-
16-
[excel.download]
17-
id="1NyNaAOw_6iWtnCpEg73AtSSFx1fMdhPRmmdOhjgjCZI"
18-
name = "ade.xlsx"
19-
path = "."
20-
21-
[excel.parse]
22-
global_sheet_prefix = "GLOBAL "
23-
board_sheet_prefix = "BOARD "
24-
table_prefix = "[TABLE] "
25-
[excel.parse.global]
26-
address_table = "addresses"
27-
backend_key = "Backend"
28-
blcu_address_key = "BLCU"
29-
units_table = "units"
30-
ports_table = "ports"
31-
board_ids_table = "board_ids"
32-
message_ids_table = "message_ids"
14+
boardsList = ["VCU"]

0 commit comments

Comments
 (0)