feat: Enable CI in cross compiled environment #35
Workflow file for this run
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
name: Github Actions | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
# run riscv tests | |
host_x86: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3.2.0 | |
- name: build artifact | |
run: | | |
apt-get install device-tree-compiler | |
mkdir build | |
cd build | |
../configure --prefix=/opt/riscv | |
make | |
wget https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.10.18/riscv64-elf-ubuntu-20.04-gcc-nightly-2023.10.18-nightly.tar.gz | |
sudo mkdir /opt/riscv | |
sudo tar -xzf riscv64-elf-ubuntu-20.04-gcc-nightly-2023.10.18-nightly.tar.gz -C /opt/ | |
export PATH=$PATH:/opt/riscv/bin | |
sh scripts/cross-test.sh | |
# for validate test cases | |
host_arm: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
arch: [armv7, aarch64] | |
cxx_compiler: [g++-10, clang++-11] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3.2.0 | |
- name: build artifact | |
# The Github Action for non-x86 CPU | |
# https://github.com/uraimo/run-on-arch-action | |
uses: uraimo/run-on-arch-action@v2.5.0 | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ubuntu20.04 | |
env: | | |
CXX: ${{ matrix.cxx_compiler }} | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y "${{ matrix.cxx_compiler }}" make | |
apt-get install -q -y gcc | |
run: | | |
make check | |
coding_style: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3.2.0 | |
- name: style check | |
# clang-format version should be set | |
run: | | |
sudo apt-get install -q -y clang-format | |
sh scripts/check-format.sh | |
shell: bash |