Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RISC-V host CI #8

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Github Actions

on:
push:
branches: [main]
pull_request:
branches: [main]
[push, pull_request]

jobs:
cross_compile_tests:
Expand All @@ -26,6 +23,26 @@ jobs:
export ENABLE_TEST_ALL=true
sh scripts/cross-test.sh

host_riscv:
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v3.2.0
- name: build artifact
uses: uraimo/run-on-arch-action@v2.5.0
with:
arch: riscv64
distro: ubuntu_devel
env: |
CXX: clang++
CC: clang
install: |
apt-get update -q -y
apt-get install -q -y make clang
apt-get install -q -y clang++
run: |
make test

check_test_cases:
runs-on: ubuntu-22.04
steps:
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ else
endif

ifndef CROSS_COMPILE
processor := $(shell uname -m)
ARCH_CFLAGS = -maes -mpclmul -mssse3 -msse4.2
uname_result := $(shell uname -m)
ifeq ($(uname_result),$(filter $(uname_result),riscv64))
processor = rv64
endif
else # CROSS_COMPILE was set
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
Expand All @@ -35,12 +37,6 @@ else # CROSS_COMPILE was set
$(error Unsupported cross-compiler)
endif

ifeq ($(processor),$(filter $(processor),i386 x86_64))
ARCH_CFLAGS = -maes -mpclmul -mssse3 -msse4.2
else
ARCH_CFLAGS = -march=$(processor)gcv_zba
endif

ifeq ($(SIMULATOR_TYPE), qemu)
SIMULATOR += qemu-riscv64
SIMULATOR_FLAGS = -cpu $(processor),v=true,zba=true,vlen=128
Expand All @@ -51,6 +47,12 @@ else # CROSS_COMPILE was set
endif
endif

ifeq ($(processor),$(filter $(processor),i386 x86_64))
ARCH_CFLAGS = -maes -mpclmul -mssse3 -msse4.2
else
ARCH_CFLAGS = -march=$(processor)gcv_zba
endif

CXXFLAGS += -Wall -Wcast-qual -I. $(ARCH_CFLAGS)
LDFLAGS += -lm
OBJS = \
Expand Down
Loading