Skip to content

Commit 7863e97

Browse files
committed
chore: use top-level Makefile
1 parent d166516 commit 7863e97

File tree

3 files changed

+77
-60
lines changed

3 files changed

+77
-60
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
],
88
"containerEnv": {
99
"WORKSPACE_DIR": "${containerWorkspaceFolder}",
10-
"PROMPT_COMMAND": "history -a"
10+
"PROMPT_COMMAND": "history -a",
11+
"EDITOR": "code --wait"
1112
},
1213
"customizations": {
1314
"vscode": {
@@ -18,5 +19,6 @@
1819
"terminal.integrated.defaultProfile.linux": "bash"
1920
}
2021
}
21-
}
22+
},
23+
"remoteUser": "root",
2224
}

.github/workflows/build_test.yml

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,56 @@
1-
name: Build and Test
2-
3-
on:
4-
pull_request:
5-
branches: [ main ]
6-
7-
jobs:
8-
build-project:
9-
name: Build Project
10-
runs-on: ubuntu-latest
11-
container:
12-
image: stronglytyped/arm-none-eabi-gcc:latest
13-
timeout-minutes: 5
14-
steps:
15-
- name: checkout code
16-
uses: actions/checkout@v3
17-
- name: print toolchain version
18-
run: arm-none-eabi-gcc --version
19-
- name: build project
20-
run: |
21-
cd nucleo-f446re/ButtonLed
22-
make
23-
- name: upload build files
24-
uses: actions/upload-artifact@v3
25-
with:
26-
name: BuildFiles
27-
retention-days: 1
28-
path: |
29-
nucleo-f446re/ButtonLed/build/ButtonLed.elf
30-
nucleo-f446re/ButtonLed/build/ButtonLed.hex
31-
run-tests:
32-
name: Run Robot tests
33-
needs: build-project
34-
runs-on: ubuntu-latest
35-
container:
36-
image: antmicro/renode:latest
37-
options: --user root
38-
timeout-minutes: 5
39-
steps:
40-
- name: checkout code
41-
uses: actions/checkout@v3
42-
- name: print renode version
43-
run: renode --version
44-
- name: download build files
45-
uses: actions/download-artifact@v3
46-
with:
47-
name: BuildFiles
48-
path: nucleo-f446re/ButtonLed/build
49-
- name: run tests
50-
run: renode-test tests/test-button.robot
51-
- name: upload results
52-
uses: actions/upload-artifact@v3
53-
with:
54-
name: TestResults
55-
retention-days: 1
56-
path: |
57-
log.html
58-
report.html
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build-project:
9+
name: Build Project
10+
runs-on: ubuntu-latest
11+
container:
12+
image: stronglytyped/arm-none-eabi-gcc:latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: checkout code
16+
uses: actions/checkout@v3
17+
- name: print toolchain version
18+
run: arm-none-eabi-gcc --version
19+
- name: build project
20+
run: make build
21+
- name: upload build files
22+
uses: actions/upload-artifact@v3
23+
with:
24+
name: BuildFiles
25+
retention-days: 1
26+
path: |
27+
nucleo-f446re/ButtonLed/build/ButtonLed.elf
28+
nucleo-f446re/ButtonLed/build/ButtonLed.hex
29+
run-tests:
30+
name: Run Robot tests
31+
needs: build-project
32+
runs-on: ubuntu-latest
33+
container:
34+
image: antmicro/renode:latest
35+
options: --user root
36+
timeout-minutes: 5
37+
steps:
38+
- name: checkout code
39+
uses: actions/checkout@v3
40+
- name: print renode version
41+
run: renode --version
42+
- name: download build files
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: BuildFiles
46+
path: nucleo-f446re/ButtonLed/build
47+
- name: run tests
48+
run: make test
49+
- name: upload results
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: TestResults
53+
retention-days: 1
54+
path: |
55+
log.html
56+
report.html

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
PROJECT_DIR := nucleo-f446re/ButtonLed
2+
TEST_FILE := tests/test-button.robot
3+
4+
.PHONY: all build test clean
5+
6+
all: build test
7+
8+
build:
9+
@echo "Building binaries in $(PROJECT_DIR)..."
10+
$(MAKE) -C $(PROJECT_DIR)
11+
12+
test:
13+
@echo "Running Renode tests..."
14+
renode-test $(TEST_FILE)
15+
16+
clean:
17+
$(MAKE) -C $(PROJECT_DIR) clean

0 commit comments

Comments
 (0)