Skip to content
Closed
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
91 changes: 69 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ defaults:
shell: bash

jobs:
# Run test on AMD64 host
test-on-amd64-host:
uses: ./.github/workflows/reuse_test.yml
with:
runs-on: ubuntu-latest
container: ghcr.io/ivila/teaclave-trustzone-sdk-ci-runner:ubuntu-24.04

# Run test on ARM64 host
test-on-arm64-host:
uses: ./.github/workflows/reuse_test.yml
with:
runs-on: ubuntu-24.04-arm
container: ghcr.io/ivila/teaclave-trustzone-sdk-ci-runner:ubuntu-24.04

# Run systest of optee_teec and build systest of optee_utee on ARM64
systest:
runs-on: ubuntu-24.04-arm
Expand All @@ -65,8 +51,28 @@ jobs:
(cd optee-teec && cargo run -p systest)
(cd optee-utee && cargo build -p systest)

# Test build no-std examples on dev docker container
test-nostd-build-on-dev-docker:
# Test cargo-optee build no-std examples - aarch64
test-cargo-optee-nostd-aarch64:
runs-on: ubuntu-latest
container:
image: teaclave/teaclave-trustzone-emulator-nostd-expand-memory:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
run: |
# Run entrypoint.sh to set up the bash profile
/entrypoint.sh true
# Install jq for JSON parsing
apt-get update && apt-get install -y jq
- name: Test cargo-optee no-std build (aarch64)
shell: bash -l {0} # Use login shell to load the profile
run: |
# Build using cargo-optee tool with default aarch64 settings
./ci/build.sh

# Test cargo-optee build no-std examples - arm32
test-cargo-optee-nostd-arm32:
runs-on: ubuntu-latest
container:
image: teaclave/teaclave-trustzone-emulator-nostd-expand-memory:latest
Expand All @@ -77,13 +83,44 @@ jobs:
run: |
# Run entrypoint.sh to set up the bash profile
/entrypoint.sh true
- name: Build no-std and common examples
# Install jq for JSON parsing
apt-get update && apt-get install -y jq
- name: Test cargo-optee no-std build (arm32)
shell: bash -l {0} # Use login shell to load the profile
run: |
make
# Switch to ARM32 configuration and build
# Note: Explicit environment reload needed for GitHub Actions
# (wrapper function in .bashrc not working for non-interactive shells: docker exec cmd=[...])
# We can fix this by updating entrypoint.sh to make ~/.profile source ~/.bashrc
switch_config --ta no-std/arm32 && \
switch_config --host arm32 && \
source ${TEACLAVE_TOOLCHAIN_BASE}/environment && \
./ci/build.sh --ta arm --host arm

# Test cargo-optee build std examples - aarch64
test-cargo-optee-std-aarch64:
runs-on: ubuntu-latest
container:
image: teaclave/teaclave-trustzone-emulator-std-expand-memory:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
run: |
# Run entrypoint.sh to set up the bash profile
/entrypoint.sh true
# Install jq for JSON parsing
apt-get update && apt-get install -y jq
- name: Test cargo-optee std build (aarch64)
shell: bash -l {0} # Use login shell to load the profile
run: |
# Link rust directory for std support
ln -s $RUST_STD_DIR rust
# Build using cargo-optee tool with default aarch64 std settings
./ci/build.sh --std

# Test build std examples on dev docker container
test-std-build-on-dev-docker:
# Test cargo-optee build std examples - arm32
test-cargo-optee-std-arm32:
runs-on: ubuntu-latest
container:
image: teaclave/teaclave-trustzone-emulator-std-expand-memory:latest
Expand All @@ -94,11 +131,21 @@ jobs:
run: |
# Run entrypoint.sh to set up the bash profile
/entrypoint.sh true
- name: Build no-std and common examples
# Install jq for JSON parsing
apt-get update && apt-get install -y jq
- name: Test cargo-optee std build (arm32)
shell: bash -l {0} # Use login shell to load the profile
run: |
# Link rust directory for std support
ln -s $RUST_STD_DIR rust
make std-examples
# Switch to ARM32 std configuration and build
# Note: Explicit environment reload needed for GitHub Actions
# (wrapper function in .bashrc not working for non-interactive shells: docker exec cmd=[...])
# We can fix this by updating entrypoint.sh to make ~/.profile source ~/.bashrc
switch_config --ta std/arm32 && \
switch_config --host arm32 && \
source ${TEACLAVE_TOOLCHAIN_BASE}/environment && \
./ci/build.sh --ta arm --host arm --std

license:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ header:
- '**/Cargo.lock'
- 'KEYS'
- 'DISCLAIMER'
- '*.json'
- '**/*.json'
- 'examples/tls_server-rs/ta/test-ca/**'
- '**/uuid.txt'
- '**/plugin_uuid.txt'
Expand Down
99 changes: 0 additions & 99 deletions Makefile

This file was deleted.

48 changes: 25 additions & 23 deletions examples/aes-rs/host/Makefile → cargo-optee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,28 @@
# specific language governing permissions and limitations
# under the License.

NAME := aes-rs

TARGET ?= aarch64-unknown-linux-gnu
CROSS_COMPILE ?= aarch64-linux-gnu-
OBJCOPY := $(CROSS_COMPILE)objcopy
LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)gcc\"

OUT_DIR := $(CURDIR)/target/$(TARGET)/release

all: clippy host strip

clippy:
@cargo fmt
@cargo clippy --target $(TARGET_HOST) -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::panic

host: clippy
@cargo build --target $(TARGET_HOST) --release --config $(LINKER_CFG)

strip: host
@$(OBJCOPY) --strip-unneeded $(OUT_DIR)/$(NAME) $(OUT_DIR)/$(NAME)

clean:
@cargo clean
[package]
name = "cargo-optee"
version = "0.1.0"
authors = ["Teaclave Contributors <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/apache/teaclave-trustzone-sdk.git"
description = "A cargo subcommand for building OP-TEE Trusted Applications"
edition = "2021"

[[bin]]
name = "cargo-optee"
path = "src/main.rs"

[dependencies]
clap = { version = "4.5", features = ["derive"] }
anyhow = "1.0"
cargo_metadata = "0.18"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
indexmap = "=2.11.4"
env_logger = "0.11"
log = "0.4"
tempfile = "3.8"
dirs = "5.0"
Loading
Loading