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 riscv64 info and simplify macos #394

Merged
merged 10 commits into from
Sep 7, 2023
Merged
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
59 changes: 59 additions & 0 deletions .github/workflows/build-test-riscv64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and test riscv64 on ubuntu-latest

on:
push:
branches:
- main
- dev
tags:
- '**'
pull_request:
branches:
- '**'

jobs:
build:
timeout-minutes: 60
name: QEMU riscv64 via Debian on ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up QEMU on x86_64
if: startsWith(matrix.os, 'ubuntu-latest')
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: riscv64
# image: tonistiigi/binfmt:latest

- name: Build and Test
run: |
docker run --rm --platform linux/riscv64 \
-v ${{ github.workspace }}:/ws --workdir=/ws \
riscv64/debian:rc-buggy \
bash -exc '\
apt-get update && \
apt-get install -y cmake build-essential git python3-full python3-pip python3-dev && \
cmake --version && \
uname -a && \
export CP_USE_GREEN_REAPER=0 && \
pip wheel -w dist . && \
python3 -m venv venv && \
./venv/bin/python -m pip install dist/*.whl && \
./venv/bin/python -m pip install pytest && \
./venv/bin/python -m pytest -k "not k_21" -v tests/
'

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: ./dist
11 changes: 1 addition & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fno-omit-frame-pointer -fsanitize=thre
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=thread")
ENDIF()

IF (APPLE)
# on macOS "uname -m" returns the architecture (x86_64 or arm64)
execute_process(
COMMAND uname -m
RESULT_VARIABLE result
OUTPUT_VARIABLE OSX_NATIVE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF()

IF (WIN32)
set(BLAKE3_SRC
src/b3/blake3.c
Expand All @@ -141,7 +132,7 @@ set(BLAKE3_SRC
src/b3/blake3_avx512.c
src/b3/blake3_sse41.c
)
ELSEIF(OSX_NATIVE_ARCHITECTURE STREQUAL "arm64")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64|arm64")
set(BLAKE3_SRC
src/b3/blake3.c
src/b3/blake3_portable.c
Expand Down
Loading