Skip to content

ocicrypt-rs build

ocicrypt-rs build #104

name: ocicrypt-rs build
on:
push:
branches:
- 'main'
paths:
- 'ocicrypt-rs/**'
- '.github/workflows/ocicrypt_rs_build.yml'
- 'Cargo.toml'
- 'Cargo.lock'
pull_request:
paths:
- 'ocicrypt-rs/**'
- '.github/workflows/ocicrypt_rs_build.yml'
- 'Cargo.toml'
- 'Cargo.lock'
create:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ci:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- 1.76.0
- stable
# Run all steps in the compilation testing containers
container:
image: runetest/compilation-testing:ubuntu20.04
env:
LD_LIBRARY_PATH: /usr/local/lib/rats-tls
steps:
- name: Code checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Update cargo home
run: |
apt-get update && apt-get install -y cargo
cp -r /root/.cargo /github/home/.cargo
- name: Install Rust toolchain (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Install tonic's protoc dependencies
run: |
apt install -y protobuf-compiler libprotobuf-dev
- name: Build and install rats-tls
run: |
PWD=$(pwd)
cd /tmp
apt-get install -y libcurl4-openssl-dev
git clone https://github.com/inclavare-containers/rats-tls
cd rats-tls
git reset --hard 8fbfdb6
cmake -DBUILD_SAMPLES=on -H. -Bbuild
make -C build install
cd $PWD
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --all-features
- name: Run cargo build - keywrap-none
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --no-default-features
- name: Run cargo build - block cipher openssl
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --no-default-features --features=block-cipher-openssl
- name: Run cargo build - block cipher ring
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --no-default-features --features=block-cipher-ring
- name: Run cargo build - keywrap-jwe
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --no-default-features --features=keywrap-jwe
- name: Run cargo build - keywrap-keyprovider
uses: actions-rs/cargo@v1
with:
command: build
args: -p ocicrypt-rs --no-default-features --features=keywrap-keyprovider
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --all-features
- name: Run cargo test - keywrap-none
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features
- name: Run cargo test - keywrap-jwe
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features --features=keywrap-jwe
- name: Run cargo test - keywrap-keyprovider-cmd
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features --features=keywrap-keyprovider-cmd
- name: Run cargo test - keywrap-keyprovider-grpc
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features --features=keywrap-keyprovider-grpc
- name: Run cargo test - keywrap-keyprovider-ttrpc
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features --features=keywrap-keyprovider-ttrpc
- name: Run cargo test - keywrap-keyprovider-native
uses: actions-rs/cargo@v1
with:
command: test
args: -p ocicrypt-rs --no-default-features --features=keywrap-keyprovider-native
- name: Run cargo fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p ocicrypt-rs -- --check
- name: Run rust lint check
uses: actions-rs/cargo@v1
with:
command: clippy
args: -p ocicrypt-rs --all-targets --all-features -- -D warnings -A clippy::derive_partial_eq_without_eq