-
Notifications
You must be signed in to change notification settings - Fork 26
81 lines (68 loc) · 2.79 KB
/
build-debug-rust.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Rust Debug Containers
on:
push:
branches:
- dev
- bookworm
jobs:
rust-debug:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/bookworm' || github.ref == 'refs/heads/dev'
name: Rust Container Debug
strategy:
matrix:
project:
- folder: rustSlint
container: rust-slint
vendor: '{ "arch": "arm64", "torizon_arch": "aarch64" }'
steps:
- uses: actions/checkout@v3
- name: Get Host Absolute Workspace Path
run: |
echo "${{ github.workspace }}" >> abs-path
cat abs-path
- name: Setup Xonsh
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip pipx
sudo bash ./scripts/bash/setup-xonsh.sh
sudo ln -s /root/.local/bin/xonsh /usr/bin/xonsh
- name: Update torizon-utils module
run: |
pipx inject -f xonsh ./scripts/utils/pip/
- name: Build ${{ matrix.project.folder }} Dockerfile
shell: xonsh {0}
env:
PROJECT_FOLDER: ${{ matrix.project.folder }}
PROJECT_CONTAINER: ${{ matrix.project.container }}
VENDOR: ${{ matrix.project.vendor }}
DOCKER_LOGIN: localhost:5002
run: |
import os
import json
$RAISE_SUBPROC_ERROR = True
$XONSH_SHOW_TRACEBACK = True
$UPDATE_OS_ENVIRON = True
vendor = json.loads(os.environ['VENDOR'])
$TORIZON_ARCH = vendor["torizon_arch"]
$PROJECT_ARCH = vendor["arch"]
xonsh ./scripts/create-from-template.xsh \
@(f"{os.environ['GITHUB_WORKSPACE']}/{os.environ['PROJECT_FOLDER']}") \
@(f"{os.environ['PROJECT_FOLDER']}CITest") \
@(f"{os.environ['PROJECT_CONTAINER']}-ci-test") \
@(os.environ['GITHUB_WORKSPACE']) \
@(os.environ['PROJECT_FOLDER']) \
"false" \
"false"
cp "abs-path" @(f"{os.environ['GITHUB_WORKSPACE']}/{os.environ['PROJECT_FOLDER']}CITest")
os.chdir(f"{os.environ['GITHUB_WORKSPACE']}/{os.environ['PROJECT_FOLDER']}CITest")
with open(".vscode/settings.json", "r") as file:
settings_json = json.load(file)
settings_json["torizon_arch"] = os.environ['TORIZON_ARCH']
with open(".vscode/settings.json", "w") as file:
json.dump(settings_json, file, indent=4)
chmod a+rw -R .
xonsh ./.vscode/tasks.xsh run run-torizon-binfmt
xonsh ./.vscode/tasks.xsh run @(f"build-debug-{os.environ['PROJECT_ARCH']}")
xonsh ./.vscode/tasks.xsh run @(f"copy-debug-executable-{os.environ['PROJECT_ARCH']}")
xonsh ./.vscode/tasks.xsh run @(f"build-container-torizon-debug-{os.environ['PROJECT_ARCH']}")