Skip to content

Commit ebf700c

Browse files
authored
Merge pull request #327 from HyperloopUPV-H8/develop
v2.3.0
2 parents 5e63904 + b4c4589 commit ebf700c

File tree

85 files changed

+11380
-5632
lines changed

Some content is hidden

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

85 files changed

+11380
-5632
lines changed

.envrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Hyperloop H10 Development Environment
2+
#
3+
# This file is used by direnv to automatically load the development environment
4+
# when you enter this directory.
5+
#
6+
# To use:
7+
# 1. Install direnv: https://direnv.net/
8+
# 2. Run: direnv allow
9+
#
10+
# For pure shell (default):
11+
use nix

.github/workflows/release.yaml

Lines changed: 117 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,77 @@ jobs:
251251
retention-days: 7
252252
compression-level: 9
253253

254+
build-testadj:
255+
name: Build testadj executable
256+
runs-on: ${{ matrix.os }}
257+
strategy:
258+
matrix:
259+
include:
260+
- os: ubuntu-latest
261+
name: linux
262+
setup: |
263+
python3 -m pip install pyinstaller
264+
build_cmd: |
265+
cd backend/cmd
266+
pyinstaller --onefile --name testadj-linux testadj.py
267+
artifact_name: testadj-linux
268+
artifact_path: backend/cmd/dist/testadj-linux
269+
270+
- os: windows-latest
271+
name: windows
272+
setup: |
273+
python -m pip install pyinstaller
274+
build_cmd: |
275+
cd backend\cmd
276+
pyinstaller --onefile --name testadj-windows testadj.py
277+
artifact_name: testadj-windows
278+
artifact_path: backend\cmd\dist\testadj-windows.exe
279+
280+
- os: macos-latest
281+
name: macos
282+
setup: |
283+
python3 -m pip install pyinstaller
284+
build_cmd: |
285+
cd backend/cmd
286+
pyinstaller --onefile --name testadj-macos testadj.py
287+
artifact_name: testadj-macos
288+
artifact_path: backend/cmd/dist/testadj-macos
289+
290+
steps:
291+
- uses: actions/checkout@v4
292+
293+
- name: Setup Python
294+
uses: actions/setup-python@v4
295+
with:
296+
python-version: '3.x'
297+
298+
- name: Setup environment
299+
run: ${{ matrix.setup }}
300+
shell: bash
301+
302+
- name: Build testadj (Linux)
303+
if: matrix.os == 'ubuntu-latest'
304+
run: ${{ matrix.build_cmd }}
305+
shell: bash
306+
307+
- name: Build testadj (macOS)
308+
if: matrix.os == 'macos-latest'
309+
run: ${{ matrix.build_cmd }}
310+
shell: bash
311+
312+
- name: Build testadj (Windows)
313+
if: matrix.os == 'windows-latest'
314+
run: ${{ matrix.build_cmd }}
315+
shell: pwsh
316+
317+
- name: Upload artifact
318+
uses: actions/upload-artifact@v4
319+
with:
320+
name: ${{ matrix.artifact_name }}
321+
path: ${{ matrix.artifact_path }}
322+
retention-days: 7
323+
compression-level: 9
324+
254325
prepare-common-files:
255326
name: Prepare Common Files
256327
runs-on: ubuntu-latest
@@ -263,8 +334,6 @@ jobs:
263334
- name: Copy config.toml
264335
run: cp backend/cmd/config.toml common-files/
265336

266-
- name: Copy testadj.py
267-
run: cp backend/cmd/testadj.py common-files/
268337

269338
- name: Copy README.md
270339
run: cp README.md common-files/
@@ -284,7 +353,7 @@ jobs:
284353

285354
package-release:
286355
name: Package Release
287-
needs: [build-backend, build-frontend, build-updater, prepare-common-files]
356+
needs: [build-backend, build-frontend, build-updater, build-testadj, prepare-common-files]
288357
runs-on: ubuntu-latest
289358
steps:
290359
- name: Download all artifacts
@@ -312,6 +381,9 @@ jobs:
312381
# Copy Linux updater
313382
cp artifacts/updater-linux/updater-linux-amd64 release-linux/updater
314383
384+
# Copy Linux testadj
385+
cp artifacts/testadj-linux/testadj-linux release-linux/testadj
386+
315387
# Copy frontends
316388
mkdir -p release-linux/ethernet-view
317389
mkdir -p release-linux/control-station
@@ -321,9 +393,12 @@ jobs:
321393
# Copy common files
322394
cp -r artifacts/common-files/* release-linux/
323395
396+
# Set executable permissions
397+
chmod +x release-linux/backend release-linux/updater release-linux/testadj
398+
324399
# Create Linux release archive
325400
cd release-linux
326-
zip -r ../linux-$VERSION.zip .
401+
tar -czf ../linux-$VERSION.tar.gz .
327402
328403
- name: Organize Windows release files
329404
run: |
@@ -335,6 +410,9 @@ jobs:
335410
# Copy Windows updater
336411
cp artifacts/updater-windows/updater-windows-amd64.exe release-windows/updater.exe
337412
413+
# Copy Windows testadj
414+
cp artifacts/testadj-windows/testadj-windows.exe release-windows/testadj.exe
415+
338416
# Copy frontends
339417
mkdir -p release-windows/ethernet-view
340418
mkdir -p release-windows/control-station
@@ -358,6 +436,9 @@ jobs:
358436
# Copy macOS Intel updater
359437
cp artifacts/updater-macos/updater-macos-amd64 release-macos/updater
360438
439+
# Copy macOS testadj
440+
cp artifacts/testadj-macos/testadj-macos release-macos/testadj
441+
361442
# Copy frontends
362443
mkdir -p release-macos/ethernet-view
363444
mkdir -p release-macos/control-station
@@ -367,9 +448,12 @@ jobs:
367448
# Copy common files
368449
cp -r artifacts/common-files/* release-macos/
369450
451+
# Set executable permissions
452+
chmod +x release-macos/backend release-macos/updater release-macos/testadj
453+
370454
# Create macOS Intel release archive
371455
cd release-macos
372-
zip -r ../macos-intel-$VERSION.zip .
456+
tar -czf ../macos-intel-$VERSION.tar.gz .
373457
374458
- name: Organize macOS ARM64 release files
375459
run: |
@@ -381,6 +465,9 @@ jobs:
381465
# Copy macOS ARM64 updater
382466
cp artifacts/updater-macos/updater-macos-arm64 release-macos-arm64/updater
383467
468+
# Copy macOS testadj
469+
cp artifacts/testadj-macos/testadj-macos release-macos-arm64/testadj
470+
384471
# Copy frontends
385472
mkdir -p release-macos-arm64/ethernet-view
386473
mkdir -p release-macos-arm64/control-station
@@ -390,15 +477,20 @@ jobs:
390477
# Copy common files
391478
cp -r artifacts/common-files/* release-macos-arm64/
392479
480+
# Set executable permissions
481+
chmod +x release-macos-arm64/backend release-macos-arm64/updater release-macos-arm64/testadj
482+
393483
# Create macOS ARM64 release archive
394484
cd release-macos-arm64
395-
zip -r ../macos-arm64-$VERSION.zip .
485+
tar -czf ../macos-arm64-$VERSION.tar.gz .
396486
397487
- name: Upload release packages
398488
uses: actions/upload-artifact@v4
399489
with:
400490
name: releases
401-
path: "*.zip"
491+
path: |
492+
*.tar.gz
493+
*.zip
402494
retention-days: 7
403495
compression-level: 9
404496

@@ -421,9 +513,9 @@ jobs:
421513
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
422514
with:
423515
upload_url: ${{ steps.create_release.outputs.upload_url }}
424-
asset_path: ./linux-${{ github.event.inputs.version }}.zip
425-
asset_name: linux-${{ github.event.inputs.version }}.zip
426-
asset_content_type: application/zip
516+
asset_path: ./linux-${{ github.event.inputs.version }}.tar.gz
517+
asset_name: linux-${{ github.event.inputs.version }}.tar.gz
518+
asset_content_type: application/gzip
427519

428520
- name: Upload Windows package to release
429521
if: github.event_name == 'workflow_dispatch'
@@ -443,9 +535,9 @@ jobs:
443535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
444536
with:
445537
upload_url: ${{ steps.create_release.outputs.upload_url }}
446-
asset_path: ./macos-intel-${{ github.event.inputs.version }}.zip
447-
asset_name: macos-intel-${{ github.event.inputs.version }}.zip
448-
asset_content_type: application/zip
538+
asset_path: ./macos-intel-${{ github.event.inputs.version }}.tar.gz
539+
asset_name: macos-intel-${{ github.event.inputs.version }}.tar.gz
540+
asset_content_type: application/gzip
449541

450542
- name: Upload macOS ARM64 package to release
451543
if: github.event_name == 'workflow_dispatch'
@@ -454,9 +546,9 @@ jobs:
454546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
455547
with:
456548
upload_url: ${{ steps.create_release.outputs.upload_url }}
457-
asset_path: ./macos-arm64-${{ github.event.inputs.version }}.zip
458-
asset_name: macos-arm64-${{ github.event.inputs.version }}.zip
459-
asset_content_type: application/zip
549+
asset_path: ./macos-arm64-${{ github.event.inputs.version }}.tar.gz
550+
asset_name: macos-arm64-${{ github.event.inputs.version }}.tar.gz
551+
asset_content_type: application/gzip
460552

461553
- name: Upload Linux package to existing release
462554
if: github.event_name == 'release'
@@ -465,9 +557,9 @@ jobs:
465557
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
466558
with:
467559
upload_url: ${{ github.event.release.upload_url }}
468-
asset_path: ./linux-${{ github.event.release.tag_name }}.zip
469-
asset_name: linux-${{ github.event.release.tag_name }}.zip
470-
asset_content_type: application/zip
560+
asset_path: ./linux-${{ github.event.release.tag_name }}.tar.gz
561+
asset_name: linux-${{ github.event.release.tag_name }}.tar.gz
562+
asset_content_type: application/gzip
471563

472564
- name: Upload Windows package to existing release
473565
if: github.event_name == 'release'
@@ -487,9 +579,9 @@ jobs:
487579
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
488580
with:
489581
upload_url: ${{ github.event.release.upload_url }}
490-
asset_path: ./macos-intel-${{ github.event.release.tag_name }}.zip
491-
asset_name: macos-intel-${{ github.event.release.tag_name }}.zip
492-
asset_content_type: application/zip
582+
asset_path: ./macos-intel-${{ github.event.release.tag_name }}.tar.gz
583+
asset_name: macos-intel-${{ github.event.release.tag_name }}.tar.gz
584+
asset_content_type: application/gzip
493585

494586
- name: Upload macOS ARM64 package to existing release
495587
if: github.event_name == 'release'
@@ -498,6 +590,6 @@ jobs:
498590
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
499591
with:
500592
upload_url: ${{ github.event.release.upload_url }}
501-
asset_path: ./macos-arm64-${{ github.event.release.tag_name }}.zip
502-
asset_name: macos-arm64-${{ github.event.release.tag_name }}.zip
503-
asset_content_type: application/zip
593+
asset_path: ./macos-arm64-${{ github.event.release.tag_name }}.tar.gz
594+
asset_name: macos-arm64-${{ github.event.release.tag_name }}.tar.gz
595+
asset_content_type: application/gzip
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test Development Scripts
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- scripts/**
7+
workflow_dispatch:
8+
9+
jobs:
10+
test-dev-scripts:
11+
name: Test Development Scripts
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
name: linux
18+
shell: bash
19+
script: ./scripts/dev.sh
20+
21+
- os: windows-latest
22+
name: windows-powershell
23+
shell: pwsh
24+
script: .\scripts\dev.ps1
25+
26+
- os: windows-latest
27+
name: windows-cmd
28+
shell: cmd
29+
script: scripts\dev.cmd
30+
31+
- os: macos-latest
32+
name: macos
33+
shell: bash
34+
script: ./scripts/dev.sh
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@v4
41+
with:
42+
go-version: "1.21.3"
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: '18'
48+
cache: 'npm'
49+
50+
- name: Install tmux (Linux/macOS)
51+
if: matrix.os != 'windows-latest'
52+
run: |
53+
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
54+
sudo apt-get update && sudo apt-get install -y tmux
55+
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
56+
brew install tmux
57+
fi
58+
shell: bash
59+
60+
- name: Make script executable (Unix)
61+
if: matrix.os != 'windows-latest'
62+
run: chmod +x scripts/dev.sh
63+
shell: bash
64+
65+
- name: Test script help/usage
66+
run: ${{ matrix.script }}
67+
shell: ${{ matrix.shell }}
68+
continue-on-error: true
69+
70+
- name: Test dependency check
71+
run: ${{ matrix.script }} setup
72+
shell: ${{ matrix.shell }}
73+
74+
- name: Test build command
75+
run: ${{ matrix.script }} build
76+
shell: ${{ matrix.shell }}
77+
continue-on-error: true
78+
79+
- name: Test backend build (quick test)
80+
run: ${{ matrix.script }} test
81+
shell: ${{ matrix.shell }}
82+
continue-on-error: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ backend/cmd/cmd
1212
.prettierrc
1313

1414
# Claude
15-
CLAUDE.md
15+
CLAUDE*
1616
.claude

.gitmodules

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

0 commit comments

Comments
 (0)