Skip to content

CI

CI #464

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '*.md'
- 'LICENSE-APACHE'
- 'LICENSE-GPL'
branches:
- 'v0.*'
- staging
- trying
pull_request:
paths-ignore:
- '*.md'
- 'LICENSE-APACHE'
- 'LICENSE-GPL'
branches:
- mbedtls-3
- master
- 'v0.*'
merge_group:
schedule:
- cron: "0 0 * * 1" # Run CI on Monday weekly, so we can track changes from nightly rust
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
jobs:
test:
name: Test
strategy:
matrix:
include:
- rust: stable
target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
- rust: stable
target: x86_64-fortanix-unknown-sgx
os: ubuntu-24.04
- rust: stable
target: x86_64-pc-windows-msvc
os: windows-latest
- rust: stable
target: aarch64-unknown-linux-musl
os: ubuntu-24.04
- rust: beta
target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
- rust: nightly
target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
- rust: stable
target: x86_64-apple-darwin
os: macos-latest
- rust: stable
target: x86_64-pc-windows-gnu
os: ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up dependencies for windows cross compile
if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.os == 'ubuntu-24.04'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --assume-yes --no-install-recommends \
gcc-mingw-w64-x86-64 \
g++-mingw-w64-x86-64 \
libz-mingw-w64-dev \
binfmt-support \
wine wine64
- name: Cache Dependencies
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
with:
key: ${{ matrix.rust }}
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected],[email protected]
checksum: true
- name: Run tests
run: |
./ci.sh
env:
RUST_VERSION: ${{ matrix.rust }}
TARGET: ${{ matrix.target }}
MATRIX_OS: ${{ matrix.os }}
ZLIB_INSTALLED: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }}
AES_NI_SUPPORT: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }}
shell: bash
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Enforce formatting
run: |
cargo fmt --check -p mbedtls
cargo fmt --check -p mbedtls-platform-support
cargo fmt --check -p mbedtls-sys-auto
ci-success:
name: ci
if: always()
needs:
- test
- fmt
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0