Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Robot tests on CI #6

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/robot-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Robot Tests

on:
pull_request:
paths:
- '.github/workflows/robot-tests.yml'
- 'test/**'
- '!test/README.md'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
env:
CMSIS_PACK_ROOT: /home/runner/.cache/arm/packs
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install -r test/configs/requirements.txt

- name: Cache vcpkg
uses: actions/cache@v4
with:
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ runner.arch }}-
path: /home/runner/.vcpkg

- name: Prepare vcpkg env
working-directory: ./test
run: |
. <(curl https://aka.ms/vcpkg-init.sh -L)
vcpkg x-update-registry --all
vcpkg activate

- name: Activate Arm tool license
working-directory: ./test
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0

- name: Run Test
working-directory: ./test
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
python -m robot --outputdir ../reports -x junit-report.xml src/test.robot

- name: Archieve test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: reports

report:
runs-on: ubuntu-latest
needs: test
permissions: write-all
steps:
- uses: actions/checkout@v4

- name: Download reports
uses: actions/download-artifact@v4
with:
name: reports
path: reports

- name: Send report to commit
uses: joonvena/robotframework-reporter-action@v2.4
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 2 additions & 0 deletions .github/workflows/toolbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
- '**'
- '!docs/**'
- '!README.md'
- '!test/**'
pull_request:
paths:
- '.github/workflows/toolbox.yml'
- '**'
- '!docs/**'
- '!test/**'
release:
types: [published]

Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
build
# Directories
/build*/
**/run

# Files
**/stdout.txt
Empty file added test/README.md
Empty file.
2 changes: 2 additions & 0 deletions test/configs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Requirements needed
robotframework >= 7.0
16 changes: 16 additions & 0 deletions test/data/build-asm/project/AC6/AsmArm.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

AREA DATA

IF HEXADECIMAL_TEST != 11259375 ; 0xABCDEF
INFO 1, "HEXADECIMAL_TEST failed!"
ENDIF

IF DECIMAL_TEST != 1234567890
INFO 1, "DECIMAL_TEST failed!"
ENDIF

IF STRING_TEST != "String0"
INFO 1, "STRING_TEST failed!"
ENDIF

END
9 changes: 9 additions & 0 deletions test/data/build-asm/project/AC6/Auto.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

AREA DATA

IF :LNOT::DEF:AUTO_DEF
INFO 1, "AUTO_DEF is not defined!"
ENDIF

END

10 changes: 10 additions & 0 deletions test/data/build-asm/project/AC6/GnuSyntax.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

.syntax unified
.arch armv7-m

.ifndef GAS_DEF
.error "GAS_DEF is not defined!"
.endif

.end

9 changes: 9 additions & 0 deletions test/data/build-asm/project/AC6/PreProcessed.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

.syntax unified
.arch armv7-m

#ifndef PRE_PROCESSED_DEF
.error "PRE_PROCESSED_DEF is not defined!"
#endif

.end
9 changes: 9 additions & 0 deletions test/data/build-asm/project/GCC/GAS.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

.syntax unified
.arch armv7-m

.ifndef GAS_DEF
.error "GAS_DEF is not defined!"
.endif

.end
13 changes: 13 additions & 0 deletions test/data/build-asm/project/GCC/NonPreProcessed.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

.syntax unified
.arch armv7-m

#ifndef PRE_PROCESSED_DEF
.equ SET_ERR_DEF,1
#endif

.ifndef SET_ERR_DEF
.error "SET_ERR_DEF is not defined! It seems this file was preprocessed but it shouldn't!"
.endif

.end
9 changes: 9 additions & 0 deletions test/data/build-asm/project/GCC/PreProcessed.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

.syntax unified
.arch armv7-m

#ifndef PRE_PROCESSED_DEF
.error "PRE_PROCESSED_DEF is not defined!"
#endif

.end
15 changes: 15 additions & 0 deletions test/data/build-asm/project/IAR/Asm.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
MODULE ?Asm

#ifndef IAR_ASM_DEF
#error "IAR_ASM_DEF is not defined!"
#endif

EXTERN Reset_Handler_C

PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
LDR R0, =Reset_Handler_C
BX R0

END
6 changes: 6 additions & 0 deletions test/data/build-asm/project/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "RTE_Components.h"
#include CMSIS_device_header

int main(void) {
return 0;
}
53 changes: 53 additions & 0 deletions test/data/build-asm/project/project.cproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project:

components:
- component: ARM::CMSIS:CORE
- component: ARM::Device:Startup&C Startup

groups:
- group: Source
files:
- file: ./main.c

- group: GCC-CLANG
for-compiler: [GCC, CLANG]
files:
- file: ./GCC/GAS.s
for-compiler: GCC
define:
- GAS_DEF
- file: ./GCC/PreProcessed.S
define:
- PRE_PROCESSED_DEF
- file: ./GCC/NonPreProcessed.s
misc:
- ASM:
- -DPRE_PROCESSED_DEF

- group: AC6
for-compiler: AC6
files:
- file: ./AC6/AsmArm.s
define:
- HEXADECIMAL_TEST: 0xABCDEF
- DECIMAL_TEST: 1234567890
- STRING_TEST: "\"String0\""
- file: ./AC6/GnuSyntax.s
define:
- GAS_DEF
misc:
- ASM:
- -masm=gnu
- file: ./AC6/PreProcessed.S
define:
- PRE_PROCESSED_DEF
- file: ./AC6/Auto.s
define:
- AUTO_DEF

- group: IAR
for-compiler: IAR
files:
- file: ./IAR/Asm.s
define:
- IAR_ASM_DEF
27 changes: 27 additions & 0 deletions test/data/build-asm/solution.csolution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
solution:
created-for: CMSIS-Toolbox@2.2.1
cdefault:

packs:
- pack: ARM::Cortex_DFP
- pack: ARM::CMSIS

target-types:
- type: ARMCM0
device: ARMCM0

build-types:
- type: AC6
compiler: AC6

- type: GCC
compiler: GCC

# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG

projects:
- project: ./project/project.cproject.yml
6 changes: 6 additions & 0 deletions test/data/build-c/project/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "RTE_Components.h"
#include CMSIS_device_header

int main(void) {
return 0;
}
10 changes: 10 additions & 0 deletions test/data/build-c/project/project.cproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
project:

components:
- component: ARM::CMSIS:CORE
- component: ARM::Device:Startup&C Startup

groups:
- group: Source
files:
- file: ./main.c
31 changes: 31 additions & 0 deletions test/data/build-c/solution.csolution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
solution:
created-for: CMSIS-Toolbox@2.2.1
cdefault:

packs:
- pack: ARM::Cortex_DFP
- pack: ARM::CMSIS

target-types:
- type: ARMCM0
device: ARMCM0

build-types:
- type: AC6
compiler: AC6

- type: GCC
compiler: GCC
misc:
- Library:
- -lm
- -lc

# - type: IAR
# compiler: IAR

- type: CLANG
compiler: CLANG

projects:
- project: ./project/project.cproject.yml
8 changes: 8 additions & 0 deletions test/data/build-cpp/project/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "RTE_Components.h"
#include CMSIS_device_header
#include <cstddef>

int main(void) {
std::size_t s = 0;
return s;
}
10 changes: 10 additions & 0 deletions test/data/build-cpp/project/project.cproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
project:

components:
- component: ARM::CMSIS:CORE
- component: ARM::Device:Startup&C Startup

groups:
- group: Source
files:
- file: ./main.cpp
Loading
Loading