Skip to content

Commit

Permalink
workflows/pr_basic_compilation_check.yml: add wasm mode build test
Browse files Browse the repository at this point in the history
Signed-off-by: Kun Lai <me@imlk.top>
  • Loading branch information
imlk0 committed Aug 27, 2023
1 parent ffd7366 commit 919fa0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/pr_basic_compilation_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
strategy:
matrix:
tag: [anolis8.6, ubuntu20.04]
build_mode: [host, occlum, sgx, tdx, wasm]

container: runetest/compilation-testing:${{ matrix.tag }}

Expand All @@ -22,27 +23,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Compile "librats" host mode
run:
source /root/.bashrc && cmake -DRATS_BUILD_MODE="host" -DBUILD_SAMPLES=on -H. -Bbuild && make -C build install && make -C build clean && rm -rf build
env:
HOME: /root

- name: Compile "librats" occlum mode
run:
source /root/.bashrc && cmake -DRATS_BUILD_MODE="occlum" -DBUILD_SAMPLES=on -H. -Bbuild && make -C build install && make -C build clean && rm -rf build
env:
HOME: /root

- name: Compile "librats" sgx mode

- if: ${{ matrix.build_mode == 'wasm' }}
name: Run pre_build.sh (for wasm mode only)
run:
source /root/.bashrc && cmake -DRATS_BUILD_MODE="sgx" -DBUILD_SAMPLES=on -H. -Bbuild && make -C build install && make -C build clean && rm -rf build
if [[ ${{ matrix.tag }} == ubuntu* ]]; then apt-get update && apt-get install -y python3 ; else dnf makecache && dnf install -y which python3 lbzip2 file ; fi && bash wasm/emscripten/pre_build.sh
env:
HOME: /root

- name: Compile "librats" tdx mode
- name: Compile "librats" ${{ matrix.build_mode }} mode
run:
source /root/.bashrc && cmake -DRATS_BUILD_MODE="tdx" -DBUILD_SAMPLES=on -H. -Bbuild && make -C build install && make -C build clean && rm -rf build
if [[ ${{ matrix.build_mode }} == 'wasm' ]]; then
export PS1=1 && source /root/.bashrc && cmake -DRATS_BUILD_MODE="${{ matrix.build_mode }}" -H. -Bbuild && make -C build all;
else
export PS1=1 && source /root/.bashrc && cmake -DRATS_BUILD_MODE="${{ matrix.build_mode }}" -DBUILD_SAMPLES=on -H. -Bbuild && make -C build all && make -C build install;
fi
env:
HOME: /root
4 changes: 3 additions & 1 deletion wasm/emscripten/dcap/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ mkdir -p "${LIB_DIR}"

# git pull and apply patch
if [ ! -d "${DCAP_DIR}" ]; then
git clone -b ${DCAP_VERSION} https://github.com/intel/SGXDataCenterAttestationPrimitives
git clone -b ${DCAP_VERSION} --depth=1 https://github.com/intel/SGXDataCenterAttestationPrimitives || exit 1
cd ${DCAP_DIR} || exit 1
git config user.email "you@example.com" || exit 1
git config user.name "Your Name" || exit 1
git am ../patch/*.patch || exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion wasm/emscripten/openssl/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ ! -d ${OPENSSL_DIR} ]; then
fi
cd ${OPENSSL_DIR} || exit 0

emconfigure ./Configure --prefix=${SOURCE_DIR}/install linux-x86 no-asm no-threads no-engine no-hw no-weak-ssl-ciphers no-dtls no-shared no-dso
emconfigure ./Configure --prefix=${SOURCE_DIR}/install linux-x86 no-asm no-threads no-engine no-hw no-weak-ssl-ciphers no-dtls no-shared no-dso no-tests no-unit-test
sed -i -e 's|^CROSS_COMPILE.*$|CROSS_COMPILE=|g' Makefile
sed -i -e '/^CFLAGS/ s/$/ -D__STDC_NO_ATOMICS__=1/' Makefile
sed -i -e '/^CXXFLAGS/ s/$/ -D__STDC_NO_ATOMICS__=1/' Makefile
Expand Down

0 comments on commit 919fa0e

Please sign in to comment.