2023-12-06 10:34:20 +08:00
|
|
|
name: linux-hisiv500-gcc
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2023-12-26 21:25:11 +08:00
|
|
|
- ".gitea/workflows/linux-hisiv500-gcc.yaml"
|
|
|
|
- "toolchains/hisiv500.toolchain.cmake"
|
|
|
|
- "3party/**"
|
|
|
|
- "src/**"
|
|
|
|
- "tests/**"
|
|
|
|
- "CMakeLists.txt"
|
|
|
|
- "cmake/**"
|
2023-12-06 10:34:20 +08:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-12-26 21:25:11 +08:00
|
|
|
- ".gitea/workflows/linux-hisiv500-gcc.yaml"
|
|
|
|
- "toolchains/hisiv500.toolchain.cmake"
|
|
|
|
- "3party/**"
|
|
|
|
- "src/**"
|
|
|
|
- "tests/**"
|
|
|
|
- "CMakeLists.txt"
|
|
|
|
- "cmake/**"
|
2023-12-06 10:34:20 +08:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: linux-hisiv500-gcc-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
- read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
linux-gcc-hisiv500:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- name: cache-qemu
|
|
|
|
id: cache-qemu
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: qemu-install
|
2023-12-26 21:25:11 +08:00
|
|
|
key: qemu-hisiv500-install-20231206-1
|
2023-12-06 10:34:20 +08:00
|
|
|
|
|
|
|
- name: checkout-qemu
|
|
|
|
if: steps.cache-qemu.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
mkdir qemu && cd qemu
|
|
|
|
git init
|
|
|
|
git remote add origin https://gitlab.com/qemu-project/qemu.git
|
|
|
|
git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
|
|
|
|
git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
|
|
|
|
|
2023-12-08 13:30:59 +08:00
|
|
|
- name: install-qemu-build-deps
|
|
|
|
if: steps.cache-qemu.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update -y
|
|
|
|
sudo apt-get install -y autoconf automake autotools-dev ninja-build
|
|
|
|
|
2023-12-06 11:28:18 +08:00
|
|
|
- name: build-qemu
|
2023-12-06 10:34:20 +08:00
|
|
|
if: steps.cache-qemu.outputs.cache-hit != 'true'
|
2023-12-06 15:03:10 +08:00
|
|
|
run: |
|
2023-12-08 13:16:09 +08:00
|
|
|
cd qemu
|
2023-12-06 15:03:10 +08:00
|
|
|
./configure --target-list=arm-linux-user --prefix=$GITHUB_WORKSPACE/qemu-install
|
|
|
|
make -j `nproc`
|
|
|
|
make install
|
2023-12-06 10:34:20 +08:00
|
|
|
|
2023-12-06 11:01:18 +08:00
|
|
|
- name: set-qemu-cache
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
if: steps.cache-qemu.outputs.cache-hit != 'true'
|
|
|
|
with:
|
2023-12-06 11:36:19 +08:00
|
|
|
key: qemu-hisiv500-install-20231206-1
|
2023-12-06 11:01:18 +08:00
|
|
|
path: qemu-install
|
|
|
|
|
2023-12-08 13:38:46 +08:00
|
|
|
- name: build-in-container
|
2023-12-06 10:34:20 +08:00
|
|
|
uses: addnab/docker-run-action@v3
|
|
|
|
with:
|
2023-12-06 15:03:10 +08:00
|
|
|
image: tqcq/ubuntu:hisi
|
2023-12-06 10:34:20 +08:00
|
|
|
options: --rm --volumes-from ${{ env.JOB_CONTAINER_NAME }}
|
|
|
|
run: |
|
2023-12-06 10:54:09 +08:00
|
|
|
cd ${{ github.workspace }}
|
2023-12-06 15:03:10 +08:00
|
|
|
sudo apt-get update
|
2024-01-06 21:01:43 +08:00
|
|
|
sudo apt-get install -y libarchive-dev libssl-dev autoconf libtool pkg-config cmake make gcc g++ git
|
2023-12-11 10:23:43 +08:00
|
|
|
cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=toolchains/hisiv500.toolchain.cmake -DULIB_BUILD_TESTS=OFF -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-arm;-L;/opt/hisi-linux/x86-arm/arm-hisiv500-linux/"
|
2023-12-06 10:34:20 +08:00
|
|
|
cmake --build build --target all -- -j `nproc`
|
2023-12-06 11:28:18 +08:00
|
|
|
|
|
|
|
- name: test-in-centos
|
|
|
|
uses: addnab/docker-run-action@v3
|
|
|
|
with:
|
|
|
|
image: tqcq/hisi:centos
|
|
|
|
options: --rm --volumes-from ${{ env.JOB_CONTAINER_NAME }}
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}
|
2023-12-06 10:34:20 +08:00
|
|
|
export PATH=${{ github.workspace }}/qemu-install/bin:$PATH
|
2023-12-11 10:23:43 +08:00
|
|
|
cd build && ctest --output-on-failure -j `nproc`
|