Merge pull request #434 from howjmay/coverage #1256
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: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
# run riscv tests | |
cross_compile_tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout code | |
uses: actions/[email protected] | |
- name: setup riscv toolchain | |
run: | | |
mkdir /opt/riscv | |
export PATH=$PATH:/opt/riscv/bin | |
wget https://github.com/howjmay/prebuilt-riscv-spike/releases/download/latest/riscv.tar.gz | |
sudo tar -xzf riscv.tar.gz -C /opt/ | |
- name: run tests | |
run: | | |
export PATH=$PATH:/opt/riscv/bin | |
export SIMULATOR_TYPE=qemu | |
export ENABLE_TEST_ALL=true | |
sh scripts/cross-test.sh | |
# for validate test cases only | |
check_test_cases: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
arch: [aarch64] | |
cxx_compiler: [g++-10, clang++-11] | |
steps: | |
- name: checkout code | |
uses: actions/[email protected] | |
- name: build artifact | |
# The Github Action for non-x86 CPU | |
# https://github.com/uraimo/run-on-arch-action | |
uses: uraimo/[email protected] | |
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: | | |
export ENABLE_TEST_ALL=true | |
make test | |
coding_style: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout code | |
uses: actions/[email protected] | |
- 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 |