Skip to content

Commit 9ff3536

Browse files
committed
CI tests: Cypress test
1 parent 90a5f29 commit 9ff3536

3 files changed

Lines changed: 122 additions & 7 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
sed -i '/#include "cy_syslib.h"/a \\\n/* Extern declaration for delay variable */\nextern uint32_t cy_delay32kMs;' lib/psoc6pdl/drivers/source/cy_syslib.c
47+
48+
- name: Workaround for sources.list
49+
run: |
50+
# Replace sources
51+
52+
set -euxo pipefail
53+
54+
# Peek (what repos are active now)
55+
apt-cache policy
56+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
57+
58+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
59+
shopt -s nullglob
60+
61+
echo "Replace sources.list (legacy)"
62+
sudo sed -i \
63+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
64+
/etc/apt/sources.list || true
65+
66+
echo "Replace sources.list.d/*.list (legacy)"
67+
for f in /etc/apt/sources.list.d/*.list; do
68+
sudo sed -i \
69+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
70+
"$f"
71+
done
72+
73+
echo "Replace sources.list.d/*.sources (deb822)"
74+
for f in /etc/apt/sources.list.d/*.sources; do
75+
sudo sed -i \
76+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
77+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
78+
"$f"
79+
done
80+
81+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
82+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
83+
# Replace azure with our mirror (idempotent)
84+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
85+
fi
86+
87+
# Peek (verify changes)
88+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
89+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
90+
echo "--- apt-mirrors.txt ---"
91+
cat /etc/apt/apt-mirrors.txt || true
92+
93+
- name: Update repository
94+
run: sudo apt-get update
95+
96+
- name: Install cross compilers
97+
run: |
98+
sudo apt-get install -y gcc-arm-none-eabi
99+
100+
- name: make distclean
101+
run: |
102+
make distclean
103+
104+
- name: Select config
105+
run: |
106+
cp ${{inputs.config-file}} .config && make include/target.h
107+
108+
- name: Build tools
109+
run: |
110+
make -C tools/keytools && make -C tools/bin-assemble
111+
112+
- name: Build wolfboot
113+
run: |
114+
make ${{inputs.make-args}} V=1
115+
116+

.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 \

0 commit comments

Comments
 (0)