Skip to content

chore(CI): Advertise ead-none option to haxin a way that works now #8

chore(CI): Advertise ead-none option to haxin a way that works now

chore(CI): Advertise ead-none option to haxin a way that works now #8

Workflow file for this run

name: Build and test
on:
push:
# branches: [main]
# tags: 'v*'
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
# check-style:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Install Rust formatter
# run: rustup component add rustfmt
# - name: Check if code is well formatted
# run: cargo fmt --check
#
# unit-tests: # run before build because it is faster
# needs: check-style
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: false
# matrix:
# crypto_backend: [edhoc-crypto/hacspec, edhoc-crypto/psa, edhoc-crypto/rustcrypto]
# ead: [ead-none, ead-zeroconf]
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Run unit tests # note that we only add `--package edhoc-hacspec` when testing the hacspec version of the lib
# run: RUST_BACKTRACE=1 cargo test -p edhoc-rs -p edhoc-crypto -p edhoc-consts -p edhoc-ead-zeroconf --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --no-fail-fast -- --test-threads 1
#
#
# build-edhoc-package:
# needs: unit-tests
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: false
# matrix:
# crypto_backend: [edhoc-crypto/hacspec, edhoc-crypto/psa, edhoc-crypto/psa-baremetal, edhoc-crypto/cryptocell310, edhoc-crypto/rustcrypto]
# ead: [ead-none, ead-zeroconf]
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Install arm targets for Rust
# run: rustup target add thumbv7m-none-eabi && rustup target add thumbv7em-none-eabihf
# - name: Install arm gcc
# run: sudo apt-get -y update && sudo apt-get -y install gcc-arm-none-eabi
#
# - name: Build
# run: cargo build --package edhoc-rs --package edhoc-crypto --package edhoc-ead --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --release
generate-fstar:
# needs: unit-tests
runs-on: ubuntu-latest
# container: docker.io/geonnave/hax
steps:
- uses: actions/checkout@v4
- name: Generate fstar code using the main library and the hacspec crypto backend
run: |
docker run --rm -v ${{ github.workspace }}:/edhoc-rs docker.io/geonnave/hax bash -e -c "\
cd edhoc-rs
cargo-hax -C -p edhoc-rs -p edhoc-crypto --no-default-features --features='edhoc-crypto/hacspec, edhoc-ead/ead-none' --release ';' into -i '-c_wrapper::** -edhoc_rs::generate_connection_identifier_cbor -edhoc_rs::generate_connection_identifier' fstar\
"
zip -j -r edhoc-rs-fstar.zip $(find . -name *fst)
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: fstar-code
path: ./edhoc-rs-fstar.zip
#
#
# build-static-lib-and-headers:
# needs: unit-tests
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: false
# matrix:
# crypto_backend: [crypto-psa-baremetal, crypto-cryptocell310]
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Install arm targets for Rust
# run: rustup target add thumbv7em-none-eabihf
# - name: Install arm gcc
# run: sudo apt-get -y update && sudo apt-get -y install gcc-arm-none-eabi
#
# - name: Build static library, generate headers, and zip to file
# run: ./build_for_c.sh "${{ matrix.crypto_backend }}"
#
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: static-lib-and-headers
# path: ./target/staticlib-*.zip
#
#
# run-example-on-qemu:
# needs: unit-tests
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: false
# matrix:
# crypto_backend: [crypto-psa]
# ead: [ead-none, ead-zeroconf]
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Install arm targets for Rust
# run: rustup target add thumbv7m-none-eabi
# - name: Install arm gcc
# run: sudo apt-get -y update && sudo apt-get -y install gcc-arm-none-eabi
# - name: Install QEMU ARM emulator
# run: sudo apt-get -y install qemu-system-arm
#
# - name: Run tests in QEMU
# run: cd examples/edhoc-rs-no_std && cargo run --target="thumbv7m-none-eabi" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}" --release
#
#
# build-example-for-cortex-m4:
# needs: unit-tests
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: false
# matrix:
# crypto_backend: [crypto-psa, crypto-cryptocell310]
# ead: [ead-none, ead-zeroconf]
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Install arm targets for Rust
# run: rustup target add thumbv7em-none-eabihf
# - name: Install arm gcc
# run: sudo apt-get -y update && sudo apt-get -y install gcc-arm-none-eabi
#
# - name: Build example
# run: cd examples/edhoc-rs-no_std && cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="${{ matrix.crypto_backend }}, ${{ matrix.ead }}, rtt" --release
#
#
# build-coap-example:
# needs: unit-tests
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
#
# - name: Build server
# run: cargo build --bin coapserver
#
# - name: Build client
# run: cargo build --bin coapclient
#
# - name: Build coap-handler based server
# run: cargo build --bin coapserver-coaphandler
#
#
# release:
# runs-on: ubuntu-latest
# needs: [build-edhoc-package, run-example-on-qemu, build-example-for-cortex-m4, build-coap-example, generate-fstar, build-static-lib-and-headers]
# if: >-
# github.event_name == 'push' &&
# startsWith(github.event.ref, 'refs/tags')
#
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: fstar-code
# path: ./release-artifacts
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: static-lib-and-headers
# path: ./release-artifacts
# - name: Release
# uses: ncipollo/release-action@v1
# with:
# generateReleaseNotes: true
# artifacts: "release-artifacts/*"
# token: ${{ secrets.RELEASE_TOKEN }}