Skip to content

Commit

Permalink
Merge pull request #21 from spectre-project/dev-0.3.16
Browse files Browse the repository at this point in the history
Dev 0.3.16 merge into main for next release
  • Loading branch information
0xA001113 authored Oct 24, 2024
2 parents b46c66d + 2d9b0ee commit c7ca43a
Show file tree
Hide file tree
Showing 460 changed files with 20,860 additions and 6,117 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ jobs:

test:
name: Test Suite
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
# matrix:
# os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:

# Clean unnecessary files to save disk space
- name: clean unnecessary files to save space
run: |
Expand Down Expand Up @@ -68,6 +66,7 @@ jobs:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:

# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false

Expand Down Expand Up @@ -125,6 +124,9 @@ jobs:
- name: Run cargo doc tests with features=no-asm on spectre-hashes
run: cargo test --doc --release -p spectre-hashes --features=no-asm

- name: Run cargo doc
run: cargo doc --release --no-deps --workspace

lints:
name: Lints
runs-on: ubuntu-latest
Expand Down Expand Up @@ -160,7 +162,7 @@ jobs:
run: cargo clippy --workspace --tests --benches -- -D warnings

check-wasm32:
name: Check Wasm32
name: Check WASM32
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -188,6 +190,7 @@ jobs:
sudo update-alternatives --install /usr/bin/c++ c++ /usr/lib/llvm-15/bin/clang++ 0
- name: Install gcc-multilib

# gcc-multilib allows clang to find gnu libraries properly
run: |
sudo apt-get update
Expand Down Expand Up @@ -231,12 +234,16 @@ jobs:
run: cargo clippy -p spectre-wasm --target wasm32-unknown-unknown

build-wasm32:
name: Build Wasm32
name: Build WASM32 SDK
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Environment
shell: bash
run: echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
Expand All @@ -259,6 +266,7 @@ jobs:
sudo update-alternatives --install /usr/bin/c++ c++ /usr/lib/llvm-15/bin/clang++ 0
- name: Install gcc-multilib

# gcc-multilib allows clang to find gnu libraries properly
run: |
sudo apt-get update
Expand Down Expand Up @@ -293,20 +301,25 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build wasm release
- name: Build WASM release
env:
TARGET_CC: clang
TARGET_CFLAGS: -I/usr/include
run: cd wasm && bash build-release
run: |
pushd .
cd wasm
bash build-release
popd
mv wasm/release/spectre-wasm32-sdk.zip wasm/release/spectre-wasm32-sdk-${{ env.SHORT_SHA }}.zip
- name: Upload wasm binary to GitHub
- name: Upload WASM build to GitHub
uses: actions/upload-artifact@v4
with:
name: spectre-wasm32-sdk
path: wasm/release/spectre-wasm32-sdk.zip
name: spectre-wasm32-sdk-${{ env.SHORT_SHA }}.zip
path: wasm/release/spectre-wasm32-sdk-${{ env.SHORT_SHA }}.zip

build-release:
name: Build Ubuntu Release
name: Build Linux Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -337,7 +350,8 @@ jobs:

- name: Build on Linux
if: runner.os == 'Linux'

# We're using musl to make the binaries statically linked and portable
run: |
cargo install cargo-zigbuild
cargo --verbose zigbuild --bin spectred --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version
cargo --verbose zigbuild --bin spectred --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version
21 changes: 14 additions & 7 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ jobs:
sudo update-alternatives --install /usr/bin/c++ c++ /usr/lib/llvm-15/bin/clang++ 0
- name: Install gcc-multilib

# gcc-multilib allows clang to find gnu libraries properly.
# gcc-multilib allows clang to find gnu libraries properly
run: sudo apt install -y gcc-multilib

- name: Install stable toolchain
Expand Down Expand Up @@ -366,13 +365,21 @@ jobs:
TARGET_CC: clang
TARGET_CFLAGS: -I/usr/include
run: |
mkdir sdk || true
cd wasm
bash build-release
mv release/spectre-wasm32-sdk.zip ../sdk/spectre-wasm32-sdk-${{ github.event.release.tag_name }}.zip
mv release/spectre-wasm32-sdk.zip ../spectre-wasm32-sdk-${{ github.event.release.tag_name }}.zip
archive="spectre-wasm32-sdk-${{ github.event.release.tag_name }}.zip"
asset_name="spectre-wasm32-sdk-${{ github.event.release.tag_name }}.zip"
echo "archive=${archive}" >> $GITHUB_ENV
echo "asset_name=${asset_name}" >> $GITHUB_ENV
- name: Upload WASM32 SDK
uses: softprops/action-gh-release@v2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
sdk/*.zip
upload_url: ${{ github.event.release.upload_url }}
asset_path: "./${{ env.archive }}"
asset_name: "${{ env.asset_name }}"
asset_content_type: application/zip
Loading

0 comments on commit c7ca43a

Please sign in to comment.