xref: /optee_os/.github/workflows/ci.yml (revision 5fe5dd14dbd813f9937f19c8d0e1409c64e99590)
1b10b4515SJerome Forissiername: CI
2b10b4515SJerome Forissieron: [push, pull_request]
39c16bc95SAlexpermissions:
49c16bc95SAlex  contents: read # to fetch code (actions/checkout)
5b10b4515SJerome Forissierjobs:
6b10b4515SJerome Forissier  code_style:
7b10b4515SJerome Forissier    name: Code style
8b10b4515SJerome Forissier    runs-on: ubuntu-latest
9b10b4515SJerome Forissier    container: jforissier/optee_os_ci
10b10b4515SJerome Forissier    steps:
11b10b4515SJerome Forissier      - name: Checkout
12c847c2c9SJerome Forissier        uses: actions/checkout@v4
13b10b4515SJerome Forissier        with:
143957cdc4SJerome Forissier          fetch-depth: 0 # full history so checkpatch can check commit IDs in commit messages
15b10b4515SJerome Forissier      - name: Update Git config
16b10b4515SJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
17b10b4515SJerome Forissier      - name: Run checkpatch
18b10b4515SJerome Forissier        shell: bash
19b10b4515SJerome Forissier        run: |
20b10b4515SJerome Forissier          # checkpatch task
21b10b4515SJerome Forissier          set -e
22b10b4515SJerome Forissier          pushd . >/dev/null
23b10b4515SJerome Forissier          mkdir -p /tmp/linux/scripts
24b10b4515SJerome Forissier          cd /tmp/linux/scripts
25b10b4515SJerome Forissier          wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/checkpatch.pl
26b10b4515SJerome Forissier          chmod +x checkpatch.pl
27b10b4515SJerome Forissier          wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/spelling.txt
28b10b4515SJerome Forissier          echo "invalid.struct.name" >const_structs.checkpatch
29b10b4515SJerome Forissier          export PATH=/tmp/linux/scripts:$PATH
30b10b4515SJerome Forissier          popd >/dev/null
31b10b4515SJerome Forissier          source scripts/checkpatch_inc.sh
32b10b4515SJerome Forissier          function _do() { echo '>>' $*; $*; }
33b10b4515SJerome Forissier          # Run checkpatch.pl:
34b10b4515SJerome Forissier          # - on the tip of the branch only if we're not in a pull request
35b10b4515SJerome Forissier          # - otherwise:
36b10b4515SJerome Forissier          #   * on each commit in the development branch that is not in the target (merge to) branch
37b10b4515SJerome Forissier          #   * on the global diff if the PR contains more than one commit (useful to check if fixup
38b10b4515SJerome Forissier          #     commits do solve previous checkpatch errors)
39b10b4515SJerome Forissier          if [ "${GITHUB_EVENT_NAME}" = "push" ]; then \
40b10b4515SJerome Forissier            _do checkpatch HEAD || failed=1; \
41b10b4515SJerome Forissier          else \
42b10b4515SJerome Forissier            for c in $(git rev-list HEAD^1..HEAD^2); do \
43b10b4515SJerome Forissier              _do checkpatch $c || failed=1; \
44b10b4515SJerome Forissier            done; \
45b10b4515SJerome Forissier            if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then \
46b10b4515SJerome Forissier              _do checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2) || failed=1; \
47b10b4515SJerome Forissier            fi; \
48b10b4515SJerome Forissier          fi
49b10b4515SJerome Forissier          [ -z "$failed" ]
50b10b4515SJerome Forissier      - name: Run pycodestyle
5132692b31SJerome Forissier        if: success() || failure()
52b10b4515SJerome Forissier        run: |
53b10b4515SJerome Forissier          # pycodestyle task
54b10b4515SJerome Forissier          sudo -E bash -c "apt update -qq -y && apt install -qq -y pycodestyle"
55b10b4515SJerome Forissier          pycodestyle scripts/*.py core/arch/arm/plat-stm32mp1/scripts/stm32image.py
56b10b4515SJerome Forissier  builds:
57b10b4515SJerome Forissier    name: make (multi-platform)
58b10b4515SJerome Forissier    runs-on: ubuntu-latest
59b10b4515SJerome Forissier    container: jforissier/optee_os_ci
60b10b4515SJerome Forissier    steps:
61b10b4515SJerome Forissier      - name: Restore build cache
62d0f80467SJerome Forissier        uses: actions/cache@v4
63b10b4515SJerome Forissier        with:
64b10b4515SJerome Forissier          path: /github/home/.cache/ccache
65b10b4515SJerome Forissier          key: builds-cache-${{ github.sha }}
66b10b4515SJerome Forissier          restore-keys: |
67b10b4515SJerome Forissier            builds-cache-
68b10b4515SJerome Forissier      - name: Checkout
69c847c2c9SJerome Forissier        uses: actions/checkout@v4
70835688acSJerome Forissier      - name: Update Git config
71835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
72b10b4515SJerome Forissier      - shell: bash
73b10b4515SJerome Forissier        run: |
74b10b4515SJerome Forissier          # build task
75b10b4515SJerome Forissier          set -e -v
76b10b4515SJerome Forissier          export LC_ALL=C
77b10b4515SJerome Forissier          export PATH=/usr/local/bin:$PATH  # clang
78030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
79b10b4515SJerome Forissier          export CFG_DEBUG_INFO=n
80b10b4515SJerome Forissier          export CFG_WERROR=y
81b10b4515SJerome Forissier
82b10b4515SJerome Forissier          function _make() { make -j$(nproc) -s O=out $*; }
8366370233SJorge Ramirez-Ortiz          function download_plug_and_trust() { mkdir -p $HOME/se050 && git clone --single-branch -b v0.4.2 https://github.com/foundriesio/plug-and-trust $HOME/se050/plug-and-trust || (rm -rf $HOME/se050 ; echo Nervermind); }
845cc24a60SNicola Mazzucato
85bf870398SVincent Guittot          function download_scp_firmware() { git clone --single-branch https://git.gitlab.arm.com/firmware/SCP-firmware.git $HOME/scp-firmware &&  git -C $HOME/scp-firmware checkout d80521fb511c6b377e41de62e20556fcbb4355f4 || (rm -rf $HOME/scp-firmware ; echo Nervermind); }
86b10b4515SJerome Forissier
87b10b4515SJerome Forissier          ccache -s -v
88b10b4515SJerome Forissier          download_plug_and_trust
895948737dSEtienne Carriere          download_scp_firmware
90b10b4515SJerome Forissier
9127acbe2bSJerome Forissier          export CROSS_COMPILE32="ccache arm-linux-gnueabihf-"
9227acbe2bSJerome Forissier          export CROSS_COMPILE64="ccache aarch64-linux-gnu-"
9327acbe2bSJerome Forissier
94b10b4515SJerome Forissier          _make
95b10b4515SJerome Forissier          _make COMPILER=clang
96b10b4515SJerome Forissier          _make CFG_TEE_CORE_LOG_LEVEL=4 CFG_TEE_CORE_DEBUG=y CFG_TEE_TA_LOG_LEVEL=4 CFG_CC_OPT_LEVEL=0 CFG_DEBUG_INFO=y
97b10b4515SJerome Forissier          _make CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n CFG_TEE_TA_LOG_LEVEL=0 CFG_DEBUG_INFO=n CFG_ENABLE_EMBEDDED_TESTS=n
98b10b4515SJerome Forissier          _make CFG_TEE_CORE_MALLOC_DEBUG=y CFG_CORE_DEBUG_CHECK_STACKS=y
9983d0edeeSJerome Forissier          _make CFG_CORE_SANITIZE_KADDRESS=y CFG_CORE_ASLR=n
100b10b4515SJerome Forissier          _make CFG_LOCKDEP=y
101b10b4515SJerome Forissier          _make CFG_CRYPTO=n
102b10b4515SJerome Forissier          _make CFG_CRYPTO_{AES,DES}=n
103b10b4515SJerome Forissier          _make CFG_CRYPTO_{DSA,RSA,DH}=n
104b10b4515SJerome Forissier          _make CFG_CRYPTO_{DSA,RSA,DH,ECC}=n
105b10b4515SJerome Forissier          _make CFG_CRYPTO_{H,C,CBC_}MAC=n
106b10b4515SJerome Forissier          _make CFG_CRYPTO_{G,C}CM=n
107b10b4515SJerome Forissier          _make CFG_CRYPTO_{MD5,SHA{1,224,256,384,512,512_256}}=n
108b10b4515SJerome Forissier          _make CFG_WITH_PAGER=y out/core/tee{,-pager,-pageable}.bin
109b10b4515SJerome Forissier          _make CFG_WITH_PAGER=y CFG_CRYPTOLIB_NAME=mbedtls CFG_CRYPTOLIB_DIR=lib/libmbedtls
110b10b4515SJerome Forissier          _make CFG_WITH_PAGER=y CFG_WITH_LPAE=y
111b10b4515SJerome Forissier          _make CFG_WITH_LPAE=y
1129cded664SJens Wiklander          _make CFG_CORE_PREALLOC_EL0_TBLS=y
113b10b4515SJerome Forissier          _make CFG_RPMB_FS=y
114b10b4515SJerome Forissier          _make CFG_RPMB_FS=y CFG_RPMB_TESTKEY=y
115b10b4515SJerome Forissier          _make CFG_REE_FS=n CFG_RPMB_FS=y
116b10b4515SJerome Forissier          _make CFG_WITH_PAGER=y CFG_WITH_LPAE=y CFG_RPMB_FS=y CFG_DT=y CFG_TEE_CORE_LOG_LEVEL=1 CFG_TEE_CORE_DEBUG=y CFG_CC_OPT_LEVEL=0 CFG_DEBUG_INFO=y
117b10b4515SJerome Forissier          _make CFG_WITH_PAGER=y CFG_WITH_LPAE=y CFG_RPMB_FS=y CFG_DT=y CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n DEBUG=0
118b10b4515SJerome Forissier          _make CFG_BUILT_IN_ARGS=y CFG_PAGEABLE_ADDR=0 CFG_NS_ENTRY_ADDR=0 CFG_DT_ADDR=0 CFG_DT=y
119b10b4515SJerome Forissier          _make CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_ULIBS_SHARED=y
120b10b4515SJerome Forissier          _make CFG_TA_GPROF_SUPPORT=y CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y CFG_ULIBS_MCOUNT=y
121b10b4515SJerome Forissier          _make CFG_SECURE_DATA_PATH=y
122b10b4515SJerome Forissier          _make CFG_REE_FS_TA_BUFFERED=y
123b10b4515SJerome Forissier          _make CFG_WITH_USER_TA=n
1244dc19277SClement Faure          _make CFG_{ATTESTATION,DEVICE_ENUM,RTC,SCMI,SECSTOR_TA_MGT}_PTA=y CFG_WITH_STATS=y CFG_TA_STATS=y
125b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a
126b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a COMPILER=clang
127b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_TEE_CORE_LOG_LEVEL=0 CFG_TEE_CORE_DEBUG=n CFG_TEE_TA_LOG_LEVEL=0 CFG_DEBUG_INFO=n
1289655e48eSClement Faure          _make PLATFORM=vexpress-qemu_armv8a CFG_TEE_CORE_LOG_LEVEL=4 CFG_TEE_CORE_DEBUG=y CFG_TEE_TA_LOG_LEVEL=4 CFG_CC_OPT_LEVEL=0 CFG_DEBUG_INFO=y
129b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_WITH_PAGER=y
130b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_ULIBS_SHARED=y
131b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_TA_GPROF_SUPPORT=y CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y CFG_ULIBS_MCOUNT=y
132b76b2296SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_NS_VIRTUALIZATION=y
1339cded664SJens Wiklander          _make PLATFORM=vexpress-qemu_armv8a CFG_CORE_PREALLOC_EL0_TBLS=y
1348bf10029SRaymond Mao          _make PLATFORM=vexpress-qemu_armv8a CFG_TRANSFER_LIST=y CFG_MAP_EXT_DT_SECURE=y
135b10b4515SJerome Forissier          _make PLATFORM=vexpress-qemu_armv8a CFG_CORE_SEL1_SPMC=y
1363ce90223SJens Wiklander          _make PLATFORM=vexpress-qemu_armv8a CFG_CORE_SEL2_SPMC=y CFG_CORE_PHYS_RELOCATABLE=y CFG_TZDRAM_START=0x0d304000 CFG_TZDRAM_SIZE=0x00cfc000
1374dc19277SClement Faure          _make PLATFORM=vexpress-qemu_armv8a CFG_{ATTESTATION,DEVICE_ENUM,RTC,SCMI,SECSTOR_TA_MGT}_PTA=y CFG_WITH_STATS=y CFG_TA_STATS=y
138faef0dd6SJens Wiklander          _make PLATFORM=vexpress-qemu_armv8a CFG_CORE_SEL1_SPMC=y CFG_NS_VIRTUALIZATION=y
139b10b4515SJerome Forissier          dd if=/dev/urandom of=BL32_AP_MM.fd bs=2621440 count=1 && _make PLATFORM=vexpress-qemu_armv8a CFG_STMM_PATH=BL32_AP_MM.fd CFG_RPMB_FS=y CFG_CORE_HEAP_SIZE=524288 CFG_TEE_RAM_VA_SIZE=0x00400000
1405948737dSEtienne Carriere          if [ -d $HOME/scp-firmware ]; then _make PLATFORM=vexpress-qemu_armv8a CFG_SCMI_SCPFW=y CFG_SCP_FIRMWARE=$HOME/scp-firmware; fi
141b10b4515SJerome Forissier          _make PLATFORM=stm-b2260
142b10b4515SJerome Forissier          _make PLATFORM=stm-cannes
143b10b4515SJerome Forissier          _make PLATFORM=stm32mp1
144d07ddf93SEtienne Carriere          _make PLATFORM=stm32mp1-135F_DK CFG_DRIVERS_CLK_PRINT_TREE=y CFG_DRIVERS_REGULATOR_PRINT_TREE=y
145f11639b2SEtienne Carriere          _make PLATFORM=stm32mp1-135F_DK COMPILER=clang
1465948737dSEtienne Carriere          if [ -d $HOME/scp-firmware ]; then _make PLATFORM=stm32mp1-157C_DK2 CFG_SCMI_SCPFW=y CFG_SCP_FIRMWARE=$HOME/scp-firmware; fi
14776438b80SGatien Chevallier          _make PLATFORM=stm32mp2
148b10b4515SJerome Forissier          _make PLATFORM=vexpress-fvp
149b10b4515SJerome Forissier          _make PLATFORM=vexpress-fvp CFG_ARM64_core=y
150b10b4515SJerome Forissier          _make PLATFORM=vexpress-fvp CFG_ARM64_core=y CFG_CORE_SEL1_SPMC=y CFG_SECURE_PARTITION=y
1515948737dSEtienne Carriere          if [ -d $HOME/scp-firmware ]; then _make PLATFORM=vexpress-fvp CFG_SCMI_SCPFW=y CFG_SCP_FIRMWARE=$HOME/scp-firmware; fi
152b10b4515SJerome Forissier          _make PLATFORM=vexpress-juno
153b10b4515SJerome Forissier          _make PLATFORM=vexpress-juno CFG_ARM64_core=y
154b10b4515SJerome Forissier          _make PLATFORM=hikey
155b10b4515SJerome Forissier          _make PLATFORM=hikey CFG_ARM64_core=y
156b10b4515SJerome Forissier          _make PLATFORM=mediatek-mt8173
157b10b4515SJerome Forissier          _make PLATFORM=mediatek-mt8175
158b10b4515SJerome Forissier          _make PLATFORM=mediatek-mt8183
159b10b4515SJerome Forissier          _make PLATFORM=mediatek-mt8516
160b10b4515SJerome Forissier          _make PLATFORM=imx-mx6ulevk
161b10b4515SJerome Forissier          _make PLATFORM=imx-mx6ulevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
162b10b4515SJerome Forissier          _make PLATFORM=imx-mx6ul9x9evk
163b10b4515SJerome Forissier          _make PLATFORM=imx-mx6ullevk CFG_WITH_SOFTWARE_PRNG=n CFG_IMX_RNGB=y
164cf4c4622SJorge Ramirez-Ortiz          if [ -d $HOME/se050/plug-and-trust ]; then _make PLATFORM=imx-mx6ullevk CFG_NXP_SE05X=y CFG_IMX_I2C=y CFG_STACK_{THREAD,TMP}_EXTRA=8192 CFG_CRYPTO_DRV_{CIPHER,ACIPHER}=y CFG_WITH_SOFTWARE_PRNG=n CFG_NXP_SE05X_{DIEID,RNG,RSA,ECC,CTR}_DRV=y CFG_NXP_SE05X_RSA_DRV_FALLBACK=y CFG_NXP_SE05X_ECC_DRV_FALLBACK=y CFG_NXP_SE05X_PLUG_AND_TRUST=$HOME/se050/plug-and-trust ; fi
165b10b4515SJerome Forissier          _make PLATFORM=imx-mx6ulzevk
166b10b4515SJerome Forissier          _make PLATFORM=imx-mx6slevk
167b10b4515SJerome Forissier          _make PLATFORM=imx-mx6sllevk
168b10b4515SJerome Forissier          _make PLATFORM=imx-mx6sxsabreauto
169b10b4515SJerome Forissier          _make PLATFORM=imx-mx6sxsabresd
170b10b4515SJerome Forissier          _make PLATFORM=imx-mx6sxsabresd CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
171b10b4515SJerome Forissier          _make PLATFORM=imx-mx6solosabresd
172b10b4515SJerome Forissier          _make PLATFORM=imx-mx6solosabreauto
173b10b4515SJerome Forissier          _make PLATFORM=imx-mx6sxsabreauto
174b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qsabrelite
175b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qsabresd
176b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qsabresd CFG_RPMB_FS=y
177b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qsabreauto
178b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qsabreauto CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
179b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qpsabreauto
180b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qpsabresd
181b10b4515SJerome Forissier          _make PLATFORM=imx-mx6dlsabresd
182b10b4515SJerome Forissier          _make PLATFORM=imx-mx6dlsabreauto
183b10b4515SJerome Forissier          _make PLATFORM=imx-mx6dapalis
184b10b4515SJerome Forissier          _make PLATFORM=imx-mx6qapalis
185b10b4515SJerome Forissier          _make PLATFORM=imx-mx7dsabresd
186b10b4515SJerome Forissier          _make PLATFORM=imx-mx7dsabresd CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
187b10b4515SJerome Forissier          _make PLATFORM=imx-mx7ulpevk
188b10b4515SJerome Forissier          _make PLATFORM=imx-mx8mmevk
189b10b4515SJerome Forissier          _make PLATFORM=imx-mx8mmevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
190cf4c4622SJorge Ramirez-Ortiz          if [ -d $HOME/se050/plug-and-trust ]; then _make PLATFORM=imx-mx8mmevk CFG_NXP_CAAM=y CFG_NXP_CAAM_RNG_DRV=y CFG_NXP_SE05X=y CFG_IMX_I2C=y CFG_STACK_{THREAD,TMP}_EXTRA=8192 CFG_CRYPTO_DRV_{CIPHER,ACIPHER}=y CFG_NXP_SE05X_RNG_DRV=n CFG_WITH_SOFTWARE_PRNG=n CFG_NXP_SE05X_{DIEID,RSA,ECC,CTR}_DRV=y CFG_NXP_SE05X_RSA_DRV_FALLBACK=y CFG_NXP_SE05X_ECC_DRV_FALLBACK=y CFG_NXP_SE05X_PLUG_AND_TRUST=$HOME/se050/plug-and-trust ; fi
191b10b4515SJerome Forissier          _make PLATFORM=imx-mx8mnevk
192b10b4515SJerome Forissier          _make PLATFORM=imx-mx8mqevk
193b10b4515SJerome Forissier          _make PLATFORM=imx-mx8mpevk
194b10b4515SJerome Forissier          _make PLATFORM=imx-mx8qxpmek
19537f820d6SClement Faure          _make PLATFORM=imx-mx8dxmek
196b10b4515SJerome Forissier          _make PLATFORM=imx-mx8qmmek
197b10b4515SJerome Forissier          _make PLATFORM=imx-mx8dxlevk
198b10b4515SJerome Forissier          _make PLATFORM=imx-mx8ulpevk
199b10b4515SJerome Forissier          _make PLATFORM=imx-mx8ulpevk CFG_NXP_CAAM=y CFG_CRYPTO_DRIVER=y
200cb34c33eSClement Faure          _make PLATFORM=imx-mx93evk
201*5fe5dd14SSahil Malhotra          _make PLATFORM=imx-mx95evk
202b10b4515SJerome Forissier          _make PLATFORM=k3-j721e
203b10b4515SJerome Forissier          _make PLATFORM=k3-j721e CFG_ARM64_core=y
2040b28c65fSJayesh Choudhary          _make PLATFORM=k3-j784s4
2050b28c65fSJayesh Choudhary          _make PLATFORM=k3-j784s4 CFG_ARM64_core=y
206b10b4515SJerome Forissier          _make PLATFORM=k3-am65x
207b10b4515SJerome Forissier          _make PLATFORM=k3-am65x CFG_ARM64_core=y
208b10b4515SJerome Forissier          _make PLATFORM=k3-am64x
209b10b4515SJerome Forissier          _make PLATFORM=k3-am64x CFG_ARM64_core=y
210b10b4515SJerome Forissier          _make PLATFORM=k3-am62x
211b10b4515SJerome Forissier          _make PLATFORM=k3-am62x CFG_ARM64_core=y
212b10b4515SJerome Forissier          _make PLATFORM=ti-dra7xx out/core/tee{,-pager,-pageable}.bin
213b10b4515SJerome Forissier          _make PLATFORM=ti-am57xx
214b10b4515SJerome Forissier          _make PLATFORM=ti-am43xx
215b10b4515SJerome Forissier          _make PLATFORM=sprd-sc9860
216b10b4515SJerome Forissier          _make PLATFORM=sprd-sc9860 CFG_ARM64_core=y
217b10b4515SJerome Forissier          _make PLATFORM=ls-ls1043ardb
218b10b4515SJerome Forissier          _make PLATFORM=ls-ls1046ardb
219b10b4515SJerome Forissier          _make PLATFORM=ls-ls1012ardb
220b10b4515SJerome Forissier          _make PLATFORM=ls-ls1028ardb
221b10b4515SJerome Forissier          _make PLATFORM=ls-ls1088ardb
222b10b4515SJerome Forissier          _make PLATFORM=ls-ls2088ardb
223b10b4515SJerome Forissier          _make PLATFORM=ls-lx2160ardb
224b10b4515SJerome Forissier          _make PLATFORM=ls-lx2160aqds
225b10b4515SJerome Forissier          _make PLATFORM=zynq7k-zc702
226b10b4515SJerome Forissier          _make PLATFORM=zynqmp-zcu102
227b10b4515SJerome Forissier          _make PLATFORM=zynqmp-zcu102 CFG_ARM64_core=y
2285ba2acecSVesa Jääskeläinen          _make PLATFORM=zynqmp-zcu102 CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=n CFG_XIPHERA_TRNG=y CFG_ZYNQMP_HUK=y
229b10b4515SJerome Forissier          _make PLATFORM=d02
230b10b4515SJerome Forissier          _make PLATFORM=d02 CFG_ARM64_core=y
231b10b4515SJerome Forissier          _make PLATFORM=rcar
232b10b4515SJerome Forissier          _make PLATFORM=rzg
233b10b4515SJerome Forissier          _make PLATFORM=rzg CFG_ARM64_core=y
234b10b4515SJerome Forissier          _make PLATFORM=rpi3
235b10b4515SJerome Forissier          _make PLATFORM=rpi3 CFG_ARM64_core=y
236b10b4515SJerome Forissier          _make PLATFORM=hikey-hikey960
237b10b4515SJerome Forissier          _make PLATFORM=hikey-hikey960 COMPILER=clang
238b10b4515SJerome Forissier          _make PLATFORM=hikey-hikey960 CFG_ARM64_core=y
239b10b4515SJerome Forissier          _make PLATFORM=hikey-hikey960 CFG_ARM64_core=y COMPILER=clang
240b10b4515SJerome Forissier          _make PLATFORM=hikey-hikey960 CFG_SECURE_DATA_PATH=n
241b10b4515SJerome Forissier          _make PLATFORM=poplar
242b10b4515SJerome Forissier          _make PLATFORM=poplar CFG_ARM64_core=y
243b10b4515SJerome Forissier          _make PLATFORM=rockchip-rk322x
244b10b4515SJerome Forissier          _make PLATFORM=rockchip-rk3399
245b10b4515SJerome Forissier          _make PLATFORM=sam
246de80c329SThomas Perrot          _make PLATFORM=sam-sama5d2_xplained
2474cc1b64dSThomas Perrot          _make PLATFORM=sam-sama5d27_som1_ek
2486807d41fSEtienne Carriere          _make PLATFORM=sam-sama5d27_wlsom1_ek
249b10b4515SJerome Forissier          _make PLATFORM=marvell-armada7k8k
250b10b4515SJerome Forissier          _make PLATFORM=marvell-armada3700
251b10b4515SJerome Forissier          _make PLATFORM=marvell-otx2t96
252b10b4515SJerome Forissier          _make PLATFORM=marvell-otx2f95
253b10b4515SJerome Forissier          _make PLATFORM=marvell-otx2t98
2549115cdfaSGowthami          _make PLATFORM=marvell-cn10ka
2559115cdfaSGowthami          _make PLATFORM=marvell-cn10kb
2569115cdfaSGowthami          _make PLATFORM=marvell-cnf10ka
2579115cdfaSGowthami          _make PLATFORM=marvell-cnf10kb
258b10b4515SJerome Forissier          _make PLATFORM=synquacer
259b10b4515SJerome Forissier          _make PLATFORM=sunxi-bpi_zero
260b10b4515SJerome Forissier          _make PLATFORM=sunxi-sun50i_a64
261b10b4515SJerome Forissier          _make PLATFORM=bcm-ns3 CFG_ARM64_core=y
262b10b4515SJerome Forissier          _make PLATFORM=hisilicon-hi3519av100_demo
263b10b4515SJerome Forissier          _make PLATFORM=amlogic
264b10b4515SJerome Forissier          _make PLATFORM=rzn1
265d8d2e5e6SJorge Ramirez-Ortiz          _make PLATFORM=versal CFG_VERSAL_FPGA_DDR_ADDR=0x40000000
26642f66171SVishnu Banavath          _make PLATFORM=corstone1000
26728a029b5SMargarita Glushkin          _make PLATFORM=nuvoton
268c25f5007Sloubaihui          _make PLATFORM=d06
269a8cfcdf2Sloubaihui          _make PLATFORM=d06 CFG_HISILICON_ACC_V3=y
270b10b4515SJerome Forissier
27127acbe2bSJerome Forissier          export ARCH=riscv
27227acbe2bSJerome Forissier          unset CROSS_COMPILE32
27327acbe2bSJerome Forissier          export CROSS_COMPILE64="ccache riscv64-linux-gnu-"
27427acbe2bSJerome Forissier
27527acbe2bSJerome Forissier          _make PLATFORM=virt
27627acbe2bSJerome Forissier
277021a43d3SJerome Forissier  QEMUv7_check:
278021a43d3SJerome Forissier    name: make check (QEMUv7)
279021a43d3SJerome Forissier    runs-on: ubuntu-latest
280021a43d3SJerome Forissier    container: jforissier/optee_os_ci:qemu_check
281021a43d3SJerome Forissier    steps:
282021a43d3SJerome Forissier      - name: Remove /__t/*
283021a43d3SJerome Forissier        run: rm -rf /__t/*
284021a43d3SJerome Forissier      - name: Restore build cache
285d0f80467SJerome Forissier        uses: actions/cache@v4
286021a43d3SJerome Forissier        with:
287021a43d3SJerome Forissier          path: /github/home/.cache/ccache
288021a43d3SJerome Forissier          key: qemuv7_check-cache-${{ github.sha }}
289021a43d3SJerome Forissier          restore-keys: |
290021a43d3SJerome Forissier            qemuv7_check-cache-
291021a43d3SJerome Forissier      - name: Checkout
292021a43d3SJerome Forissier        uses: actions/checkout@v4
293835688acSJerome Forissier      - name: Update Git config
294835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
295021a43d3SJerome Forissier      - shell: bash
296021a43d3SJerome Forissier        run: |
297021a43d3SJerome Forissier          # make check task
298021a43d3SJerome Forissier          set -e -v
299021a43d3SJerome Forissier          export LC_ALL=C
300021a43d3SJerome Forissier          export BR2_CCACHE_DIR=/github/home/.cache/ccache
301030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
302021a43d3SJerome Forissier          export CFG_TEE_CORE_LOG_LEVEL=0
303021a43d3SJerome Forissier          WD=$(pwd)
304021a43d3SJerome Forissier          cd ..
305021a43d3SJerome Forissier          TOP=$(pwd)/optee
306021a43d3SJerome Forissier          /root/get_optee.sh default ${TOP}
307021a43d3SJerome Forissier          mv ${TOP}/optee_os ${TOP}/optee_os_old
308021a43d3SJerome Forissier          ln -s ${WD} ${TOP}/optee_os
309021a43d3SJerome Forissier          cd ${TOP}/build
310021a43d3SJerome Forissier
311021a43d3SJerome Forissier          make -j$(nproc) check CFG_LOCKDEP=y CFG_LOCKDEP_RECORD_STACK=n CFG_IN_TREE_EARLY_TAS=pkcs11/fd02c9da-306c-48c7-a49c-bbd827ae86ee CFG_PKCS11_TA=y
312021a43d3SJerome Forissier
313b10b4515SJerome Forissier  QEMUv8_check:
314b10b4515SJerome Forissier    name: make check (QEMUv8)
315b10b4515SJerome Forissier    runs-on: ubuntu-latest
3164f00b5beSJerome Forissier    container: jforissier/optee_os_ci:qemu_check
317b10b4515SJerome Forissier    steps:
318fa195005SJerome Forissier      - name: Remove /__t/*
319fa195005SJerome Forissier        run: rm -rf /__t/*
320b10b4515SJerome Forissier      - name: Restore build cache
321d0f80467SJerome Forissier        uses: actions/cache@v4
322b10b4515SJerome Forissier        with:
323b10b4515SJerome Forissier          path: /github/home/.cache/ccache
324b10b4515SJerome Forissier          key: qemuv8_check-cache-${{ github.sha }}
325b10b4515SJerome Forissier          restore-keys: |
326b10b4515SJerome Forissier            qemuv8_check-cache-
327b10b4515SJerome Forissier      - name: Checkout
328c847c2c9SJerome Forissier        uses: actions/checkout@v4
329835688acSJerome Forissier      - name: Update Git config
330835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
331b10b4515SJerome Forissier      - shell: bash
332b10b4515SJerome Forissier        run: |
333b10b4515SJerome Forissier          # make check task
334baa05d63SJerome Forissier          set -e -v
335b10b4515SJerome Forissier          export LC_ALL=C
336f8ea228aSJerome Forissier          export BR2_CCACHE_DIR=/github/home/.cache/ccache
337030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
33870a5b401SJerome Forissier          export CFG_TEE_CORE_LOG_LEVEL=0
33940be56c9SJerome Forissier          export CFG_ATTESTATION_PTA=y
34040be56c9SJerome Forissier          export CFG_ATTESTATION_PTA_KEY_SIZE=1024
341ee726ae9SJerome Forissier          OPTEE_OS_TO_TEST=$(pwd)
3425f1d31ffSJerome Forissier          cd ..
3435f1d31ffSJerome Forissier          TOP=$(pwd)/optee_repo_qemu_v8
3444f00b5beSJerome Forissier          /root/get_optee.sh qemu_v8 ${TOP}
3455f1d31ffSJerome Forissier          mv ${TOP}/optee_os ${TOP}/optee_os_old
346ee726ae9SJerome Forissier          ln -s ${OPTEE_OS_TO_TEST} ${TOP}/optee_os
3475f1d31ffSJerome Forissier          cd ${TOP}/build
348b10b4515SJerome Forissier
3495f1d31ffSJerome Forissier          make -j$(nproc) check
3505f1d31ffSJerome Forissier          make -j$(nproc) check CFG_CRYPTO_WITH_CE82=y
351ce44b9dfSJerome Forissier          # Rust is disabled because signature_verification-rs hangs with this OP-TEE configuration
352ce44b9dfSJerome Forissier          make -j$(nproc) check CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y XTEST_ARGS=regression_1001 RUST_ENABLE=n
353a012b992SSeonghyun Park          make -j$(nproc) check CFG_PAN=y
3546d7d9de3SJerome Forissier          make -j$(nproc) check CFG_WITH_PAGER=y
355b10b4515SJerome Forissier
35611af44c2SJerome Forissier  QEMUv8_Xen_check:
35711af44c2SJerome Forissier    name: make check (QEMUv8, Xen)
35811af44c2SJerome Forissier    runs-on: ubuntu-latest
3594f00b5beSJerome Forissier    container: jforissier/optee_os_ci:qemu_check
36011af44c2SJerome Forissier    steps:
361b8f45155SJerome Forissier      - name: Remove /__t/*
362b8f45155SJerome Forissier        run: rm -rf /__t/*
36311af44c2SJerome Forissier      - name: Restore build cache
364d0f80467SJerome Forissier        uses: actions/cache@v4
36511af44c2SJerome Forissier        with:
36611af44c2SJerome Forissier          path: /github/home/.cache/ccache
36711af44c2SJerome Forissier          key: qemuv8_xen_check-cache-${{ github.sha }}
36811af44c2SJerome Forissier          restore-keys: |
36911af44c2SJerome Forissier            qemuv8_xen_check-cache-
37011af44c2SJerome Forissier      - name: Checkout
371c847c2c9SJerome Forissier        uses: actions/checkout@v4
372835688acSJerome Forissier      - name: Update Git config
373835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
37411af44c2SJerome Forissier      - shell: bash
37511af44c2SJerome Forissier        run: |
37611af44c2SJerome Forissier          # make check task
377baa05d63SJerome Forissier          set -e -v
37811af44c2SJerome Forissier          export LC_ALL=C
37911af44c2SJerome Forissier          export CFG_TEE_CORE_LOG_LEVEL=0
380f8ea228aSJerome Forissier          export BR2_CCACHE_DIR=/github/home/.cache/ccache
381030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
382ee726ae9SJerome Forissier          OPTEE_OS_TO_TEST=$(pwd)
3835f1d31ffSJerome Forissier          cd ..
3845f1d31ffSJerome Forissier          TOP=$(pwd)/optee_repo_qemu_v8
3854f00b5beSJerome Forissier          /root/get_optee.sh qemu_v8 ${TOP}
3865f1d31ffSJerome Forissier          mv ${TOP}/optee_os ${TOP}/optee_os_old
387ee726ae9SJerome Forissier          ln -s ${OPTEE_OS_TO_TEST} ${TOP}/optee_os
3885f1d31ffSJerome Forissier          cd ${TOP}/build
38911af44c2SJerome Forissier
3905f1d31ffSJerome Forissier          make -j$(nproc) check XEN_BOOT=y
391b10b4515SJerome Forissier
392464ebf57SJens Wiklander  QEMUv8_Xen_ffa_check:
393464ebf57SJens Wiklander    name: make check (QEMUv8, Xen FF-A)
394464ebf57SJens Wiklander    runs-on: ubuntu-latest
395464ebf57SJens Wiklander    container: jforissier/optee_os_ci:qemu_check
396464ebf57SJens Wiklander    steps:
397464ebf57SJens Wiklander      - name: Remove /__t/*
398464ebf57SJens Wiklander        run: rm -rf /__t/*
399464ebf57SJens Wiklander      - name: Restore build cache
400d0f80467SJerome Forissier        uses: actions/cache@v4
401464ebf57SJens Wiklander        with:
402464ebf57SJens Wiklander          path: /github/home/.cache/ccache
403464ebf57SJens Wiklander          key: qemuv8_xen_ffa_check-cache-${{ github.sha }}
404464ebf57SJens Wiklander          restore-keys: |
405464ebf57SJens Wiklander            qemuv8_xen_ffa_check-cache-
406464ebf57SJens Wiklander      - name: Checkout
407464ebf57SJens Wiklander        uses: actions/checkout@v4
408464ebf57SJens Wiklander      - name: Update Git config
409464ebf57SJens Wiklander        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
410464ebf57SJens Wiklander      - shell: bash
411464ebf57SJens Wiklander        run: |
412464ebf57SJens Wiklander          # make check task
413464ebf57SJens Wiklander          set -e -v
414464ebf57SJens Wiklander          export LC_ALL=C
415464ebf57SJens Wiklander          export CFG_TEE_CORE_LOG_LEVEL=0
416464ebf57SJens Wiklander          export BR2_CCACHE_DIR=/github/home/.cache/ccache
417030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
418464ebf57SJens Wiklander          OPTEE_OS_TO_TEST=$(pwd)
419464ebf57SJens Wiklander          cd ..
420464ebf57SJens Wiklander          TOP=$(pwd)/optee_repo_qemu_v8
421464ebf57SJens Wiklander          /root/get_optee.sh qemu_v8 ${TOP}
422464ebf57SJens Wiklander          mv ${TOP}/optee_os ${TOP}/optee_os_old
423464ebf57SJens Wiklander          ln -s ${OPTEE_OS_TO_TEST} ${TOP}/optee_os
424464ebf57SJens Wiklander          cd ${TOP}/build
425464ebf57SJens Wiklander
426464ebf57SJens Wiklander          make -j$(nproc) check XEN_BOOT=y SPMC_AT_EL=1
427464ebf57SJens Wiklander
4283427eb2aSJens Wiklander  QEMUv8_Hafnium_check:
4293427eb2aSJens Wiklander    name: make check (QEMUv8, Hafnium)
4303427eb2aSJens Wiklander    runs-on: ubuntu-latest
4314f00b5beSJerome Forissier    container: jforissier/optee_os_ci:qemu_check
4323427eb2aSJens Wiklander    steps:
433a03aafedSJerome Forissier      - name: Remove /__t/*
434a03aafedSJerome Forissier        run: rm -rf /__t/*
4353427eb2aSJens Wiklander      - name: Restore build cache
436d0f80467SJerome Forissier        uses: actions/cache@v4
4373427eb2aSJens Wiklander        with:
4383427eb2aSJens Wiklander          path: /github/home/.cache/ccache
4393427eb2aSJens Wiklander          key: qemuv8_hafnium_check-cache-${{ github.sha }}
4403427eb2aSJens Wiklander          restore-keys: |
4413427eb2aSJens Wiklander            qemuv8_hafnium_check-cache-
4423427eb2aSJens Wiklander      - name: Checkout
443c847c2c9SJerome Forissier        uses: actions/checkout@v4
444835688acSJerome Forissier      - name: Update Git config
445835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
4463427eb2aSJens Wiklander      - shell: bash
4473427eb2aSJens Wiklander        run: |
4483427eb2aSJens Wiklander          # make check task
4493427eb2aSJens Wiklander          set -e -v
4503427eb2aSJens Wiklander          export LC_ALL=C
4513427eb2aSJens Wiklander          export CFG_TEE_CORE_LOG_LEVEL=0
4523427eb2aSJens Wiklander          export BR2_CCACHE_DIR=/github/home/.cache/ccache
453030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
454ee726ae9SJerome Forissier          OPTEE_OS_TO_TEST=$(pwd)
4553427eb2aSJens Wiklander          cd ..
4563427eb2aSJens Wiklander          TOP=$(pwd)/optee_repo_qemu_v8
4574f00b5beSJerome Forissier          /root/get_optee.sh qemu_v8 ${TOP}
4583427eb2aSJens Wiklander          mv ${TOP}/optee_os ${TOP}/optee_os_old
459ee726ae9SJerome Forissier          ln -s ${OPTEE_OS_TO_TEST} ${TOP}/optee_os
4603427eb2aSJens Wiklander          cd ${TOP}/build
4613427eb2aSJens Wiklander
4623427eb2aSJens Wiklander          make -j$(nproc) check SPMC_AT_EL=2
4633427eb2aSJens Wiklander
46429711e3bSJerome Forissier  QEMUv8_check_BTI_MTE_PAC:
46529711e3bSJerome Forissier    name: make check (QEMUv8, BTI+MTE+PAC)
46629711e3bSJerome Forissier    runs-on: ubuntu-latest
4674f00b5beSJerome Forissier    container: jforissier/optee_os_ci:qemu_check
46829711e3bSJerome Forissier    steps:
469fa195005SJerome Forissier      - name: Remove /__t/*
470fa195005SJerome Forissier        run: rm -rf /__t/*
47129711e3bSJerome Forissier      - name: Restore build cache
472d0f80467SJerome Forissier        uses: actions/cache@v4
47329711e3bSJerome Forissier        with:
47429711e3bSJerome Forissier          path: /github/home/.cache/ccache
47529711e3bSJerome Forissier          key: qemuv8_check_bti_mte_pac-cache-${{ github.sha }}
47629711e3bSJerome Forissier          restore-keys: |
47729711e3bSJerome Forissier            qemuv8_check_bti_mte_pac-cache-
47829711e3bSJerome Forissier      - name: Checkout
479c847c2c9SJerome Forissier        uses: actions/checkout@v4
480835688acSJerome Forissier      - name: Update Git config
481835688acSJerome Forissier        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
48229711e3bSJerome Forissier      - shell: bash
48329711e3bSJerome Forissier        run: |
48429711e3bSJerome Forissier          # make check task
48529711e3bSJerome Forissier          set -e -v
48629711e3bSJerome Forissier          export LC_ALL=C
48729711e3bSJerome Forissier          # The BTI-enabled toolchain is aarch64-unknown-linux-uclibc-gcc in /usr/local/bin
48829711e3bSJerome Forissier          export PATH=/usr/local/bin:$PATH
48929711e3bSJerome Forissier          export AARCH64_CROSS_COMPILE=aarch64-unknown-linux-uclibc-
49029711e3bSJerome Forissier          export BR2_CCACHE_DIR=/github/home/.cache/ccache
491030b3574SJerome Forissier          export FORCE_UNSAFE_CONFIGURE=1 # Prevent Buildroot error when building as root
49229711e3bSJerome Forissier          export CFG_TEE_CORE_LOG_LEVEL=0
49329711e3bSJerome Forissier          export CFG_USER_TA_TARGETS=ta_arm64
494ee726ae9SJerome Forissier          OPTEE_OS_TO_TEST=$(pwd)
4955f1d31ffSJerome Forissier          cd ..
4965f1d31ffSJerome Forissier          TOP=$(pwd)/optee_repo_qemu_v8
4975f1d31ffSJerome Forissier          # TF-A v2.6 fails to build with the above toolchain so override it
4985f1d31ffSJerome Forissier          export TF_A_EXPORTS="CROSS_COMPILE=${TOP}/toolchains/aarch64/bin/aarch64-linux-gnu-"
4994f00b5beSJerome Forissier          /root/get_optee.sh qemu_v8 ${TOP}
50029711e3bSJerome Forissier          # QEMU v7.2.0 has an issue with MTE
50129711e3bSJerome Forissier          # https://github.com/OP-TEE/optee_os/issues/5759#issuecomment-1380590951
5025f1d31ffSJerome Forissier          cd ${TOP}/qemu && git fetch github && git checkout 13356edb87
5035f1d31ffSJerome Forissier          mv ${TOP}/optee_os ${TOP}/optee_os_old
504ee726ae9SJerome Forissier          ln -s ${OPTEE_OS_TO_TEST} ${TOP}/optee_os
5055f1d31ffSJerome Forissier          cd ${TOP}/build
50629711e3bSJerome Forissier
50729711e3bSJerome Forissier          # xtest 1031 is excluded because 1031.4 (C++ exception from shared library) fails with this cross-compiler
508ce44b9dfSJerome Forissier          # Rust is disabled because of a link error in the examples with this toolchain
509ce44b9dfSJerome Forissier          make -j$(nproc) CFG_CORE_BTI=y CFG_TA_BTI=y MEMTAG=y PAUTH=y RUST_ENABLE=n XTEST_ARGS="-x 1031" check
510