-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from abeimler/feature/cross-arm
- Loading branch information
Showing
40 changed files
with
968 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: ci-cross-arm | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
Test: | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-22.04 | ||
cmake: | ||
- true | ||
task: | ||
- rpi4:build.cross | ||
- rpi4-vcpkg:build.cross | ||
- rpi4:build.cross.custom-toolchain | ||
- rpi3:build.cross | ||
include: | ||
- task: rpi4:build.cross | ||
install-cross-compiler: g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
target: aarch64-linux-gnu | ||
- task: rpi4-vcpkg:build.cross | ||
install-cross-compiler: g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
target: aarch64-linux-gnu | ||
- task: rpi4:build.cross.custom-toolchain | ||
install-cross-compiler: g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
target: aarch64-linux-gnu | ||
- task: rpi3:build.cross | ||
install-cross-compiler: gcc-arm-none-eabi binutils-arm-none-eabi | ||
target: arm-none-eabi | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/vcpkg | ||
./build/vcpkg_installed | ||
${{ env.HOME }}/.cache/vcpkg/archives | ||
${{ env.XDG_CACHE_HOME }}/vcpkg/archives | ||
${{ env.LOCALAPPDATA }}\vcpkg\archives | ||
${{ env.APPDATA }}\vcpkg\archives | ||
key: ${{ runner.os }}-cross-${{ matrix.target }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}-${{ matrix.cmake }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ env.BUILD_TYPE }}- | ||
- name: Setup Cpp | ||
uses: aminya/setup-cpp@v1 | ||
with: | ||
cmake: ${{ matrix.cmake }} | ||
ninja: true | ||
vcpkg: true | ||
conan: true | ||
cppcheck: true | ||
clangtidy: true | ||
task: true | ||
doxygen: true | ||
powershell: true | ||
|
||
- name: Setup ARM (Cross) Compiler | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: ${{ matrix.install-cross-compiler }} | ||
version: 1.0 | ||
|
||
- name: Build (Task) | ||
run: | | ||
task ${{ matrix.task }} | ||
env: | ||
CMAKE_GENERATOR: ${{ matrix.cmake_generator }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
cmake: | ||
- true | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM ubuntu:22.04 AS base | ||
|
||
# add setup-cpp https://github.com/aminya/setup-cpp | ||
RUN apt-get update && apt-get install -y \ | ||
npm \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN npm install -g setup-cpp | ||
|
||
|
||
|
||
FROM base AS setup | ||
|
||
# install cmake, ninja, and ccache | ||
RUN setup-cpp --clangtidy true --clangformat true --cmake true --ninja true --ccache true --cppcheck true --vcpkg true --conan true --task true | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./docker/entrypoint.sh /docker-entrypoint.sh | ||
ENTRYPOINT [ "/docker-entrypoint.sh" ] | ||
|
||
|
||
FROM setup AS build | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi4:build.cross"] | ||
|
||
FROM setup AS build-debug | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi4:build.cross.debug"] | ||
|
||
FROM setup AS build-vcpkg | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi4-vcpkg:build.cross"] | ||
|
||
FROM setup AS build-custom | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi4:build.cross.custom-toolchain"] | ||
|
||
|
||
FROM setup AS test | ||
RUN apt-get update && apt-get install -y \ | ||
qemu-user \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
ENV QEMU_LD_PREFIX /usr/aarch64-linux-gnu | ||
CMD ["/bin/bash", "-c", "task rpi4:build.cross && qemu-aarch64 /home/project_options/tests/rpi4/build/Release/example"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ubuntu:22.04 AS base | ||
|
||
# add setup-cpp https://github.com/aminya/setup-cpp | ||
RUN apt-get update && apt-get install -y \ | ||
npm \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN npm install -g setup-cpp | ||
|
||
|
||
|
||
FROM base AS setup | ||
|
||
# install cmake, ninja, and ccache | ||
RUN setup-cpp --clangtidy true --clangformat true --cmake true --ninja true --ccache true --cppcheck true --vcpkg true --conan true --task true | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
gcc-arm-none-eabi binutils-arm-none-eabi \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./docker/entrypoint.sh /docker-entrypoint.sh | ||
ENTRYPOINT [ "/docker-entrypoint.sh" ] | ||
|
||
|
||
FROM setup AS build | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi3:build.cross"] | ||
|
||
|
||
FROM setup AS build-debug | ||
COPY . /home/project_options | ||
WORKDIR /home/project_options | ||
RUN git submodule update --init | ||
CMD ["/bin/bash", "-c", "task rpi3:build.cross.debug"] |
Oops, something went wrong.