Skip to content

Commit 1bc325d

Browse files
authored
Merge pull request #644 from jackctj117/Extend-CI-tests
CI tests: Cypress test
2 parents fb891c1 + feec841 commit 1bc325d

File tree

4 files changed

+126
-7
lines changed

4 files changed

+126
-7
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Wolfboot Reusable Build Workflow for Cypress PSoC6
2+
3+
on:
4+
5+
workflow_call:
6+
inputs:
7+
arch:
8+
required: true
9+
type: string
10+
config-file:
11+
required: true
12+
type: string
13+
make-args:
14+
required: false
15+
type: string
16+
17+
jobs:
18+
19+
build:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- uses: actions/checkout@v4
29+
with:
30+
repository: Infineon/psoc6pdl
31+
path: lib/psoc6pdl
32+
33+
- uses: actions/checkout@v4
34+
with:
35+
repository: Infineon/TARGET_CY8CKIT-062S2-43012
36+
path: lib/TARGET_CY8CKIT-062S2-43012
37+
38+
- uses: actions/checkout@v4
39+
with:
40+
repository: Infineon/core-lib
41+
path: lib/core-lib
42+
43+
- name: Patch cy_syslib.c to declare cy_delay32kMs
44+
run: |
45+
# Add extern declaration for cy_delay32kMs directly in cy_syslib.c
46+
# Find the line with the include and add the extern declaration after it
47+
awk '/#include "cy_syslib.h"/ {print; print ""; print "/* Extern declaration for delay variable */"; print "extern uint32_t cy_delay32kMs;"; next} 1' \
48+
lib/psoc6pdl/drivers/source/cy_syslib.c > /tmp/cy_syslib_patched.c
49+
mv /tmp/cy_syslib_patched.c lib/psoc6pdl/drivers/source/cy_syslib.c
50+
51+
- name: Workaround for sources.list
52+
run: |
53+
# Replace sources
54+
55+
set -euxo pipefail
56+
57+
# Peek (what repos are active now)
58+
apt-cache policy
59+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
60+
61+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
62+
shopt -s nullglob
63+
64+
echo "Replace sources.list (legacy)"
65+
sudo sed -i \
66+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
67+
/etc/apt/sources.list || true
68+
69+
echo "Replace sources.list.d/*.list (legacy)"
70+
for f in /etc/apt/sources.list.d/*.list; do
71+
sudo sed -i \
72+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
73+
"$f"
74+
done
75+
76+
echo "Replace sources.list.d/*.sources (deb822)"
77+
for f in /etc/apt/sources.list.d/*.sources; do
78+
sudo sed -i \
79+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
80+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
81+
"$f"
82+
done
83+
84+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
85+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
86+
# Replace azure with our mirror (idempotent)
87+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
88+
fi
89+
90+
# Peek (verify changes)
91+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
92+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
93+
echo "--- apt-mirrors.txt ---"
94+
cat /etc/apt/apt-mirrors.txt || true
95+
96+
- name: Update repository
97+
run: sudo apt-get update
98+
99+
- name: Install cross compilers
100+
run: |
101+
sudo apt-get install -y gcc-arm-none-eabi
102+
103+
- name: make distclean
104+
run: |
105+
make distclean
106+
107+
- name: Select config
108+
run: |
109+
cp ${{inputs.config-file}} .config && make include/target.h
110+
111+
- name: Build tools
112+
run: |
113+
make -C tools/keytools && make -C tools/bin-assemble
114+
115+
- name: Build wolfboot
116+
run: |
117+
make ${{inputs.make-args}} V=1
118+
119+

.github/workflows/test-configs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ on:
88

99
jobs:
1010

11-
# TODO: cypsoc6.config requires cy_device_headers.h and component defines
12-
# cypsoc6_test:
13-
# uses: ./.github/workflows/test-build-psoc6.yml
14-
# with:
15-
# arch: arm
16-
# config-file: ./config/examples/cypsoc6.config
11+
cypsoc6_test:
12+
uses: ./.github/workflows/test-build-psoc6.yml
13+
with:
14+
arch: arm
15+
config-file: ./config/examples/cypsoc6.config
1716

1817
hifive1_test:
1918
uses: ./.github/workflows/test-build-riscv.yml

arch.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ ifeq ($(TARGET),psoc6)
960960
$(CYPRESS_PDL)/drivers/source/cy_crypto.o
961961

962962
CFLAGS+=\
963-
-I$(CYPRESS_PDL)/drivers/include \
964963
-I$(CYPRESS_PDL)/devices/include \
964+
-I$(CYPRESS_PDL)/drivers/include \
965965
-I$(CYPRESS_PDL)/cmsis/include \
966966
-I$(CYPRESS_TARGET_LIB) \
967967
-I$(CYPRESS_CORE_LIB)/include \

config/examples/cypsoc6.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RAM_CODE?=0
2222
DUALBANK_SWAP?=0
2323
PKA?=0
2424
WOLFTPM?=0
25+
PSOC6_CRYPTO?=0
2526
WOLFBOOT_PARTITION_SIZE?=0x80000
2627
WOLFBOOT_SECTOR_SIZE?=512
2728
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10080000

0 commit comments

Comments
 (0)