Skip to content

Commit 7f49fb6

Browse files
authored
Merge pull request #67 from HyperloopUPV-H8/develop
Merge changes for V0.1.0
2 parents c2063f0 + 4e841cd commit 7f49fb6

170 files changed

Lines changed: 5724 additions & 3266 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.
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Build backend
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
SECRET:
7+
required: true
8+
workflow_dispatch:
9+
10+
env:
11+
SECRET: ${{ secrets.SECRET }}
12+
13+
jobs:
14+
build-backend-linux:
15+
name: "Build backend for linux"
16+
runs-on: ubuntu-latest
17+
18+
# Runs on alpine because it is easier to staticly link the library
19+
container:
20+
image: golang:alpine
21+
22+
env:
23+
BACKEND_DIR: ./backend
24+
25+
steps:
26+
- name: "Install packages"
27+
run: apk update && apk add --no-cache libpcap-dev musl-dev gcc go
28+
29+
- uses: actions/checkout@v3
30+
31+
- name: "Create output path"
32+
working-directory: "${{env.BACKEND_DIR}}"
33+
run: mkdir ./output
34+
35+
- name: "Load secret"
36+
working-directory: "${{env.BACKEND_DIR}}"
37+
run: |
38+
./load-secret.sh "$SECRET"
39+
40+
- name: "Build (64 bit)"
41+
working-directory: "${{env.BACKEND_DIR}}/cmd"
42+
env:
43+
CGO_ENABLED: 1
44+
GOARCH: amd64
45+
GOOS: linux
46+
run: |
47+
go build -ldflags '-linkmode external -extldflags "-static"' -o ../output/backend-linux-64
48+
49+
- name: "Upload build"
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: backend-linux
53+
path: "${{env.BACKEND_DIR}}/output/*"
54+
55+
build-backend-windows:
56+
name: "Build backend for windows"
57+
runs-on: windows-latest
58+
59+
env:
60+
BACKEND_DIR: ".\\backend"
61+
62+
steps:
63+
- uses: actions/checkout@v3
64+
65+
- name: "Setup Go"
66+
uses: actions/setup-go@v4
67+
with:
68+
go-version: "1.19"
69+
cache-dependency-path: "${{env.BACKEND_DIR}}\\go.sum"
70+
71+
- name: "Load secret"
72+
working-directory: "${{env.BACKEND_DIR}}"
73+
run: |
74+
echo "${{env.SECRET}}" > ".\internal\excel\secret.json" &&
75+
echo "${{env.SECRET}}" > ".\internal\excel_adapter\internals\secret.json" &&
76+
echo "${{env.SECRET}}" > ".\pkg\excel\secret.json" &&
77+
echo "${{env.SECRET}}" > ".\pkg\excel_adapter\internals\secret.json"
78+
79+
- name: "Create output path"
80+
working-directory: "${{env.BACKEND_DIR}}"
81+
run: mkdir .\output
82+
83+
- name: "Build (64 bit)"
84+
working-directory: "${{env.BACKEND_DIR}}\\cmd"
85+
env:
86+
CGO_ENABLED: 1
87+
GOARCH: amd64
88+
GOOS: windows
89+
run: |
90+
go build -o ..\output\backend-windows-64.exe
91+
92+
- name: "Upload build"
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: backend-windows
96+
path: "${{env.BACKEND_DIR}}\\output\\*"
97+
98+
build-backend-mac:
99+
name: "Build backend for macOS"
100+
runs-on: macos-latest
101+
102+
env:
103+
BACKEND_DIR: ./backend
104+
105+
steps:
106+
- name: "Install packages"
107+
run: brew install libpcap
108+
109+
- name: "Setup Go"
110+
uses: actions/setup-go@v4
111+
with:
112+
go-version: "1.19"
113+
cache-dependency-path: "${{env.BACKEND_DIR}}/go.sum"
114+
115+
- uses: actions/checkout@v3
116+
117+
- name: "Create output path"
118+
working-directory: "${{env.BACKEND_DIR}}"
119+
run: mkdir ./output
120+
121+
- name: "Load secret"
122+
working-directory: "${{env.BACKEND_DIR}}"
123+
run: |
124+
./load-secret.sh "$SECRET"
125+
126+
- name: "Build (64 bit)"
127+
working-directory: "${{env.BACKEND_DIR}}/cmd"
128+
env:
129+
CGO_ENABLED: 1
130+
GOARCH: amd64
131+
GOOS: darwin
132+
run: |
133+
go build -o ../output/backend-macos-64
134+
135+
- name: "Build (apple 64 bit)"
136+
working-directory: "${{env.BACKEND_DIR}}/cmd"
137+
env:
138+
CGO_ENABLED: 1
139+
GOARCH: arm64
140+
GOOS: darwin
141+
run: |
142+
go build -o ../output/backend-macos-m1-64
143+
144+
- name: "Upload build"
145+
uses: actions/upload-artifact@v3
146+
with:
147+
name: backend-macos
148+
path: "${{env.BACKEND_DIR}}/output/*"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build ethernet view
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-ethernet-view:
9+
name: "Build ethernet view"
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
FRONTEND_DIR: ./ethernet-view
14+
COMMON_DIR: ./common-front
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: "Install common front dependencies"
20+
working-directory: "${{env.COMMON_DIR}}"
21+
run: npm install
22+
23+
24+
- name: "Build common front"
25+
working-directory: "${{env.COMMON_DIR}}"
26+
run: npm run build
27+
28+
- name: "Install ethernet view dependencies"
29+
working-directory: "${{env.FRONTEND_DIR}}"
30+
run: npm install
31+
32+
33+
- name: "Build ethernet view"
34+
working-directory: "${{env.FRONTEND_DIR}}"
35+
run: npm run build
36+
37+
38+
- name: "Upload build"
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: ethernet-view
42+
path: "${{env.FRONTEND_DIR}}/static/*"

.github/workflows/build.yaml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.github/workflows/pre-release.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
build
2-
secret.json
2+
3+
# GOOGLE API KEY
4+
secret.json
5+
6+
# MacOS Files
7+
.DS_Store

backend/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ trace.json
1010
Backend-H8
1111
backend
1212
!build
13+
# MacOS build
14+
cmd
1315

1416
# EXCEL
1517
*.xlsx
@@ -20,4 +22,4 @@ static
2022

2123
downloads
2224

23-
audience_static
25+
audience_static

0 commit comments

Comments
 (0)