44 pull_request :
55 branches :
66 - main
7+ - v4.x
78 push :
89 branches :
910 - main
10-
11+ - v4.x
1112env :
1213 RUSTFLAGS : -Dwarnings
1314 RUST_BACKTRACE : 1
1819 runs-on : ubuntu-latest
1920 steps :
2021 - uses : actions/checkout@v4
21- - name : Install Rust
22- run : rustup update stable && rustup default stable
22+ - name : Install Rustfmt
23+ run : rustup default stable && rustup component add rustfmt
2324 - name : Check formatting
2425 run : cargo fmt --all -- --check
2526
@@ -31,10 +32,11 @@ jobs:
3132 with :
3233 submodules : ' recursive'
3334 - name : Install Rust
34- run : rustup update stable && rustup default stable
35+ run : rustup update --no-self-update stable && rustup default stable && rustup component add clippy
3536 - name : Get rust version
3637 id : rust-version
37- run : echo "::set-output name=version::$(rustc --version)"
38+ run : |
39+ echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
3840 - name : Cache cargo index
3941 uses : actions/cache@v4
4042 with :
5860 key : clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
5961 - name : Run clippy
6062 run : cargo clippy --all --all-targets
63+ - name : Check docs
64+ run : cargo doc --no-deps -p boring -p boring-sys --features rpk,pq-experimental,underscore-wildcards
65+ env :
66+ CARGO_BUILD_RUSTDOCFLAGS : " --cfg=docsrs"
67+ RUST_BOOTSTRAP : 1
68+ DOCS_RS : 1
69+ - name : Cargo.toml boring versions consistency
70+ shell : bash
71+ run : |
72+ WORKSPACE_VERSION=$(grep -F '[workspace.package]' -A1 Cargo.toml | grep -F version | grep -Eo '".*"')
73+ if [[ -z "$WORKSPACE_VERSION" ]]; then echo 2>&1 "error: can't find boring version"; exit 1; fi
74+ if grep -E 'boring.* =' Cargo.toml | grep -vF "$WORKSPACE_VERSION"; then
75+ echo 2>&1 "error: boring dependencies must match workspace version $WORKSPACE_VERSION"
76+ exit 1
77+ fi
6178 test :
6279 name : Test
6380 runs-on : ${{ matrix.os }}
@@ -141,8 +158,8 @@ jobs:
141158 apt_packages : gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
142159 check_only : true
143160 custom_env :
144- CC : arm-linux-gnueabi-gcc
145- CXX : arm-linux-gnueabi-g++
161+ CC_arm-unknown-linux-gnueabi : arm-linux-gnueabi-gcc
162+ CXX_arm-unknown-linux-gnueabi : arm-linux-gnueabi-g++
146163 CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER : arm-linux-gnueabi-g++
147164 - thing : aarch64-linux
148165 target : aarch64-unknown-linux-gnu
@@ -151,8 +168,8 @@ jobs:
151168 apt_packages : crossbuild-essential-arm64
152169 check_only : true
153170 custom_env :
154- CC : aarch64-linux-gnu-gcc
155- CXX : aarch64-linux-gnu-g++
171+ CC_aarch64_unknown_linux_gnu : aarch64-linux-gnu-gcc
172+ CXX_aarch64_unknown_linux_gnu : aarch64-linux-gnu-g++
156173 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-g++
157174 - thing : arm64-macos
158175 target : aarch64-apple-darwin
@@ -301,45 +318,6 @@ jobs:
301318 - name : Build for ${{ matrix.target }}
302319 run : cargo build --target ${{ matrix.target }} --all-targets
303320
304- cross-build-fips :
305- name : Cross build from macOS to Linux (FIPS)
306- runs-on : macos-13 # Need an Intel (x86_64) runner for Clang 12.0.0
307- strategy :
308- matrix :
309- include :
310- - target : x86_64-unknown-linux-gnu
311- steps :
312- - uses : actions/checkout@v4
313- with :
314- submodules : ' recursive'
315- - name : Install Rust (rustup)
316- run : rustup update stable --no-self-update && rustup default stable && rustup target add ${{ matrix.target }}
317- shell : bash
318- - name : Install golang
319- uses : actions/setup-go@v5
320- with :
321- go-version : ' >=1.22.0'
322- - name : Install ${{ matrix.target }} toolchain
323- run : brew tap messense/macos-cross-toolchains && brew install ${{ matrix.target }} && brew link x86_64-unknown-linux-gnu
324- - name : Install Clang-12
325- uses : KyleMayes/install-llvm-action@v1
326- with :
327- version : " 12.0.0"
328- directory : ${{ runner.temp }}/llvm
329- - name : Add clang++-12 link
330- working-directory : ${{ runner.temp }}/llvm/bin
331- run : ln -s clang++ clang++-12
332- - name : Set BORING_BSSL_FIPS_COMPILER_EXTERNAL_TOOLCHAIN
333- run : echo "BORING_BSSL_FIPS_COMPILER_EXTERNAL_TOOLCHAIN=$(brew --prefix ${{ matrix.target }})/toolchain" >> $GITHUB_ENV
334- shell : bash
335- - name : Set BORING_BSSL_FIPS_SYSROOT
336- run : echo "BORING_BSSL_FIPS_SYSROOT=$BORING_BSSL_FIPS_COMPILER_EXTERNAL_TOOLCHAIN/${{ matrix.target }}/sysroot" >> $GITHUB_ENV
337- shell : bash
338- - name : Set CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER
339- run : echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=${{ matrix.target }}-gcc" >> $GITHUB_ENV
340- - name : Build for ${{ matrix.target }}
341- run : cargo build --target ${{ matrix.target }} --all-targets --features fips
342-
343321 test-features :
344322 name : Test features
345323 runs-on : ubuntu-latest
0 commit comments