Skip to content

Commit

Permalink
Merge pull request #536 from pinkforest/monorepo-t1
Browse files Browse the repository at this point in the history
Pulls ed25519-dalek and x25519-dalek in. We're now one happy monorepo.
  • Loading branch information
rozbb committed Jun 30, 2023
2 parents 2e3212b + 98a0a6f commit f789810
Show file tree
Hide file tree
Showing 113 changed files with 19,136 additions and 615 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Cross

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'

jobs:

test-cross:
name: Test
strategy:
matrix:
include:
# ARM32
- target: armv7-unknown-linux-gnueabihf
rust: stable

# ARM64
- target: aarch64-unknown-linux-gnu
rust: stable

# PPC32
- target: powerpc-unknown-linux-gnu
rust: stable

# TODO: We only test x/ed/curve for cross as derive is platform specifics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ${{ matrix.deps }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: RustCrypto/actions/cross-install@master
- run: cross test -p curve25519-dalek --release --target ${{ matrix.target }}
- run: cross test -p ed25519-dalek --release --target ${{ matrix.target }}
- run: cross test -p x25519-dalek --release --target ${{ matrix.target }}
117 changes: 117 additions & 0 deletions .github/workflows/curve25519-dalek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: curve25519 Rust

on:
push:
branches: [ '**' ]
paths: 'curve25519-dalek/**'
pull_request:
branches: [ '**' ]
paths: 'curve25519-dalek/**'

defaults:
run:
working-directory: curve25519-dalek

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'

jobs:

test-fiat:
name: Test fiat backend
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit target
- target: i686-unknown-linux-gnu
deps: sudo apt update && sudo apt install gcc-multilib

# 64-bit target
- target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add ${{ matrix.target }}
- run: ${{ matrix.deps }}
- env:
RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"'
run: cargo test --target ${{ matrix.target }}

test-serial:
name: Test serial backend
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit target
- target: i686-unknown-linux-gnu
deps: sudo apt update && sudo apt install gcc-multilib

# 64-bit target
- target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add ${{ matrix.target }}
- run: ${{ matrix.deps }}
- env:
RUSTFLAGS: '--cfg curve25519_dalek_backend="serial"'
run: cargo test --target ${{ matrix.target }}

build-script:
name: Test Build Script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: wasm32-unknown-unknown,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu
- run: bash tests/build_tests.sh

test-simd-nightly:
name: Test simd backend (nightly)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- env:
# This will:
# 1) build all of the x86_64 SIMD code,
# 2) run all of the SIMD-specific tests that the test runner supports,
# 3) run all of the normal tests using the best available SIMD backend.
# This should automatically pick up the simd backend in a x84_64 runner
RUSTFLAGS: '-C target_cpu=native'
run: cargo test --target x86_64-unknown-linux-gnu

test-simd-stable:
name: Test simd backend (stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- env:
# This will run AVX2-specific tests and run all of the normal tests
# with the AVX2 backend, even if the runner supports AVX512.
# This should automatically pick up the simd backend in a x86_64 runner
# It should pick AVX2 due to stable toolchain used since AVX512 requires nigthly
RUSTFLAGS: '-C target_feature=+avx2'
run: cargo test --no-default-features --features alloc,precomputed-tables,zeroize --target x86_64-unknown-linux-gnu

msrv:
name: Current MSRV is 1.60.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# First run `cargo +nightly -Z minimal-verisons check` in order to get a
# Cargo.lock with the oldest possible deps
- uses: dtolnay/rust-toolchain@nightly
- run: cargo -Z minimal-versions check --no-default-features --features serde
# Now check that `cargo build` works with respect to the oldest possible
# deps and the stated MSRV
- uses: dtolnay/rust-toolchain@1.60.0
- run: cargo build --no-default-features --features serde
# Also make sure the AVX2 build works
- run: cargo build --target x86_64-unknown-linux-gnu
36 changes: 36 additions & 0 deletions .github/workflows/ed25519-dalek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ed25519 Rust

on:
push:
branches: [ '**' ]
paths: 'ed25519-dalek/**'
pull_request:
branches: [ '**' ]
paths: 'ed25519-dalek/**'

defaults:
run:
working-directory: ed25519-dalek

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'
RUSTDOCFLAGS: '-D warnings'

jobs:

msrv:
name: Current MSRV is 1.60.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# First delete the checked-in `Cargo.lock`. We're going to regenerate it
- run: rm Cargo.lock
# Now run `cargo +nightly -Z minimal-verisons check` in order to get a
# Cargo.lock with the oldest possible deps
- uses: dtolnay/rust-toolchain@nightly
- run: cargo -Z minimal-versions check --no-default-features --features serde
# Now check that `cargo build` works with respect to the oldest possible
# deps and the stated MSRV
- uses: dtolnay/rust-toolchain@1.60.0
- run: cargo build
35 changes: 35 additions & 0 deletions .github/workflows/no_std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: no_std

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'

jobs:

build-nostd:
name: Build on no_std target (thumbv7em-none-eabi)
runs-on: ubuntu-latest
strategy:
matrix:
include:
- crate: curve25519-dalek
- crate: ed25519-dalek
- crate: x25519-dalek
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv7em-none-eabi
- uses: taiki-e/install-action@cargo-hack
# No default features build
- name: no_std / no feat ${{ matrix.crate }}
run: cargo build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --no-default-features
- name: no_std / cargo hack ${{ matrix.crate }}
run: cargo hack build -p ${{ matrix.crate }} --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std,getrandom
Loading

0 comments on commit f789810

Please sign in to comment.