Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Hyperloop H10 Development Environment
#
# This file is used by direnv to automatically load the development environment
# when you enter this directory.
#
# To use:
# 1. Install direnv: https://direnv.net/
# 2. Run: direnv allow
#
# For pure shell (default):
use nix
21 changes: 0 additions & 21 deletions .github/dependabot.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/ex_workflows/build-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Build backend

on:
workflow_dispatch:
pull_request:
paths:
- backend/**

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

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

env:
BACKEND_DIR: ./backend

steps:
- name: "Install packages"
run: apk update && apk add --no-cache libpcap-dev musl-dev gcc go

- uses: actions/checkout@v4
with:
sparse-checkout: backend

- name: "Create output path"
working-directory: "${{env.BACKEND_DIR}}"
run: mkdir ./output

- name: "Build (64 bit)"
working-directory: "${{env.BACKEND_DIR}}/cmd"
env:
CGO_ENABLED: 1
GOARCH: amd64
GOOS: linux
run: |
go build -ldflags '-linkmode external -extldflags "-static"' -o ../output/backend-linux-64

- name: "Upload build"
uses: actions/upload-artifact@v4
with:
name: backend-linux
path: "${{env.BACKEND_DIR}}/output/*"
retention-days: 3
compression-level: 9

build-backend-windows:
name: "Build backend for windows"
runs-on: windows-latest

env:
BACKEND_DIR: ".\\backend"

steps:
- uses: actions/checkout@v3

- name: "Setup Go"
uses: actions/setup-go@v4
with:
go-version: "1.21.3"
cache-dependency-path: "${{env.BACKEND_DIR}}\\go.sum"

- name: "Create output path"
working-directory: "${{env.BACKEND_DIR}}"
run: mkdir .\output

- name: "Build (64 bit)"
working-directory: "${{env.BACKEND_DIR}}\\cmd"
env:
CGO_ENABLED: 1
GOARCH: amd64
GOOS: windows
run: |
go build -o ..\output\backend-windows-64.exe

- name: "Upload build"
uses: actions/upload-artifact@v4
with:
name: backend-windows
path: "${{env.BACKEND_DIR}}\\output\\*"
retention-days: 3
compression-level: 9

build-backend-mac:
name: "Build backend for macOS"
runs-on: macos-latest

env:
BACKEND_DIR: ./backend

steps:
- name: "Install packages"
run: brew install libpcap

- name: "Setup Go"
uses: actions/setup-go@v4
with:
go-version: "1.21.3"
cache-dependency-path: "${{env.BACKEND_DIR}}/go.sum"

- uses: actions/checkout@v3

- name: "Create output path"
working-directory: "${{env.BACKEND_DIR}}"
run: mkdir ./output

- name: "Build (64 bit)"
working-directory: "${{env.BACKEND_DIR}}/cmd"
env:
CGO_ENABLED: 1
GOARCH: amd64
GOOS: darwin
run: |
go build -o ../output/backend-macos-64

- name: "Build (apple 64 bit)"
working-directory: "${{env.BACKEND_DIR}}/cmd"
env:
CGO_ENABLED: 1
GOARCH: arm64
GOOS: darwin
run: |
go build -o ../output/backend-macos-m1-64

- name: "Upload build"
uses: actions/upload-artifact@v4
with:
name: backend-macos
path: "${{env.BACKEND_DIR}}/output/*"
retention-days: 3
compression-level: 9
48 changes: 48 additions & 0 deletions .github/ex_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
51 changes: 51 additions & 0 deletions .github/ex_workflows/build-ethernet-view.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build ethernet view

on:
workflow_dispatch:
pull_request:
paths:
- ethernet-view/**
- common-front/**

jobs:
build-ethernet-view:
name: "Build ethernet view"
runs-on: ubuntu-latest

env:
FRONTEND_DIR: ./ethernet-view
COMMON_DIR: ./common-front

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
ethernet-view
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 ethernet view dependencies"
working-directory: "${{env.FRONTEND_DIR}}"
run: npm install


- name: "Build ethernet view"
working-directory: "${{env.FRONTEND_DIR}}"
run: npm run build


- name: "Upload build"
uses: actions/upload-artifact@v4
with:
name: ethernet-view
path: "${{env.FRONTEND_DIR}}/static/*"
retention-days: 3
compression-level: 9
Loading
Loading