Skip to content

Commit

Permalink
Merge pull request #179 from HyperloopUPV-H8/develop
Browse files Browse the repository at this point in the history
Backend V2.0.0-beta
  • Loading branch information
msanlli authored Dec 7, 2024
2 parents caa0310 + af3fe89 commit 1b5a0b3
Show file tree
Hide file tree
Showing 313 changed files with 5,752 additions and 8,447 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/build-backend.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
name: Build backend

on:
workflow_call:
secrets:
SECRET:
required: true
workflow_dispatch:
pull_request:
paths:
- backend/**

env:
SECRET: ${{ secrets.SECRET }}

jobs:
build-backend-linux:
name: "Build backend for linux"
runs-on: ubuntu-latest

# Runs on alpine because it is easier to staticly link the library
# Runs on alpine because it is easier to statically link the library
container:
image: golang:alpine

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

- name: "Load secret"
working-directory: "${{env.BACKEND_DIR}}"
run: |
./load-secret.sh "$SECRET"
- name: "Build (64 bit)"
working-directory: "${{env.BACKEND_DIR}}/cmd"
env:
Expand Down Expand Up @@ -75,14 +63,6 @@ jobs:
go-version: "1.21.3"
cache-dependency-path: "${{env.BACKEND_DIR}}\\go.sum"

- name: "Load secret"
working-directory: "${{env.BACKEND_DIR}}"
run: |
echo "$env:SECRET" > ".\internal\excel\secret.json"
echo "$env:SECRET" > ".\internal\excel_adapter\internals\secret.json"
echo "$env:SECRET" > ".\pkg\excel\secret.json"
echo "$env:SECRET" > ".\pkg\excel_adapter\internals\secret.json"
- name: "Create output path"
working-directory: "${{env.BACKEND_DIR}}"
run: mkdir .\output
Expand Down Expand Up @@ -127,11 +107,6 @@ jobs:
working-directory: "${{env.BACKEND_DIR}}"
run: mkdir ./output

- name: "Load secret"
working-directory: "${{env.BACKEND_DIR}}"
run: |
./load-secret.sh "$SECRET"
- name: "Build (64 bit)"
working-directory: "${{env.BACKEND_DIR}}/cmd"
env:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/build-control-station.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build control station

on:
workflow_dispatch:
pull_request:
paths:
- control-station/**
- common-front/**

jobs:
build-control-station:
name: 'Build control station'
runs-on: ubuntu-latest

env:
FRONTEND_DIR: ./control-station
COMMON_DIR: ./common-front

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
control-station
common-front
- name: 'Install common front dependencies'
working-directory: '${{env.COMMON_DIR}}'
run: npm install

- name: 'Build common front'
working-directory: '${{env.COMMON_DIR}}'
run: npm run build

- name: 'Install control station dependencies'
working-directory: '${{env.FRONTEND_DIR}}'
run: npm install

- name: 'Build control station'
working-directory: '${{env.FRONTEND_DIR}}'
run: npm run build

- name: 'Upload build'
uses: actions/upload-artifact@v4
with:
name: control-station
path: '${{env.FRONTEND_DIR}}/static/*'
retention-days: 3
compression-level: 9
1 change: 0 additions & 1 deletion .github/workflows/build-ethernet-view.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build ethernet view

on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/test-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
- backend/**
workflow_dispatch:

env:
SECRET: ${{ secrets.SECRET }}

jobs:
test-backend:
name: "Test backend"
Expand All @@ -35,11 +32,6 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y libpcap-dev
- name: "Load secret"
working-directory: "${{env.BACKEND_DIR}}"
run: |
./load-secret.sh "$SECRET"
- name: Test with Go
working-directory: "${{env.BACKEND_DIR}}"
run: go test -v -timeout 30s ./...
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build
profiles

# GOOGLE API KEY
secret.json
# ADJ
JSON_ADE

# MacOS Files
.DS_Store
Expand Down
2 changes: 0 additions & 2 deletions backend/cmd/config.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package main

import (
"github.com/HyperloopUPV-H8/h9-backend/internal/excel_adapter"
"github.com/HyperloopUPV-H8/h9-backend/internal/server"
"github.com/HyperloopUPV-H8/h9-backend/internal/vehicle"
)

type Config struct {
Excel excel_adapter.ExcelAdapterConfig
Vehicle vehicle.Config
Server server.Config
}
20 changes: 1 addition & 19 deletions backend/cmd/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,4 @@ connections = "/backend"
files = "/"

[vehicle]
boards = ["VCU"]

[excel.download]
id="1NyNaAOw_6iWtnCpEg73AtSSFx1fMdhPRmmdOhjgjCZI"
name = "ade.xlsx"
path = "."

[excel.parse]
global_sheet_prefix = "GLOBAL "
board_sheet_prefix = "BOARD "
table_prefix = "[TABLE] "
[excel.parse.global]
address_table = "addresses"
backend_key = "Backend"
blcu_address_key = "BLCU"
units_table = "units"
ports_table = "ports"
board_ids_table = "board_ids"
message_ids_table = "message_ids"
boardsList = ["VCU"]
Loading

0 comments on commit 1b5a0b3

Please sign in to comment.