2020-11-11 04:31:29 +00:00
|
|
|
name: ci
|
2021-04-23 18:00:02 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2020-11-11 04:31:29 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
jobs:
|
2020-12-29 20:43:22 +00:00
|
|
|
rustfmt:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-29 20:43:22 +00:00
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-29 20:43:22 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-29 20:43:22 +00:00
|
|
|
- run: cargo fmt --all -- --check
|
|
|
|
|
2020-12-08 00:23:29 +00:00
|
|
|
clippy:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-08 00:23:29 +00:00
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-08 00:23:29 +00:00
|
|
|
with:
|
2020-12-08 04:09:32 +00:00
|
|
|
toolchain: stable
|
2020-12-08 00:23:29 +00:00
|
|
|
profile: minimal
|
|
|
|
components: clippy
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-08 00:23:29 +00:00
|
|
|
|
2021-04-21 00:34:37 +00:00
|
|
|
- run: mk/clippy.sh
|
2020-12-08 00:23:29 +00:00
|
|
|
|
2020-12-02 02:34:18 +00:00
|
|
|
audit:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-02 02:34:18 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-cache@v2
|
2020-12-02 02:34:18 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/cargo-audit
|
|
|
|
~/.cargo/.crates.toml
|
|
|
|
~/.cargo/.crates2.json
|
|
|
|
key: ${{ runner.os }}-v2-cargo-audit-0.13.1
|
|
|
|
|
|
|
|
- run: cargo install cargo-audit --vers "0.13.1"
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
- run: cargo generate-lockfile
|
|
|
|
|
|
|
|
- run: cargo audit --deny warnings
|
|
|
|
|
2020-12-02 04:36:57 +00:00
|
|
|
deny:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-02 04:36:57 +00:00
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-02 04:36:57 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-cache@v2
|
2020-12-02 04:36:57 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/cargo-deny
|
|
|
|
~/.cargo/.crates.toml
|
|
|
|
~/.cargo/.crates2.json
|
2021-02-17 07:56:32 +00:00
|
|
|
key: ${{ runner.os }}-v2-cargo-deny-locked-0.8.5
|
2020-12-02 04:36:57 +00:00
|
|
|
|
2021-02-17 07:56:32 +00:00
|
|
|
- run: cargo install cargo-deny --locked --vers "0.8.5"
|
2020-12-02 04:36:57 +00:00
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-02 04:36:57 +00:00
|
|
|
|
|
|
|
- run: cargo deny check
|
|
|
|
|
2020-12-02 02:34:18 +00:00
|
|
|
# Verify that documentation builds.
|
|
|
|
rustdoc:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust_channel:
|
|
|
|
- stable
|
|
|
|
- beta
|
2020-12-02 03:01:36 +00:00
|
|
|
- nightly
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
include:
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-02 02:34:18 +00:00
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
toolchain: ${{ matrix.rust_channel }}
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
- run: |
|
|
|
|
cargo doc --all-features
|
|
|
|
|
2021-04-09 23:08:10 +00:00
|
|
|
package:
|
2023-08-30 00:13:59 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2021-04-09 23:08:10 +00:00
|
|
|
|
|
|
|
steps:
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2021-04-09 23:08:10 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-04-09 23:08:10 +00:00
|
|
|
|
|
|
|
- run: cargo package
|
|
|
|
|
|
|
|
|
2020-11-11 04:31:29 +00:00
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.host_os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
features:
|
|
|
|
- # Default
|
2021-01-06 21:44:05 +00:00
|
|
|
- --features=alloc
|
2020-12-30 01:42:02 +00:00
|
|
|
- --all-features
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
target:
|
2020-12-29 23:41:16 +00:00
|
|
|
# There is no platform-specific code in webpki. Choose a handful of
|
|
|
|
# platforms mostly to smoketest that the build machinery in mk/ is
|
|
|
|
# portable.
|
2020-11-11 04:31:29 +00:00
|
|
|
- arm-unknown-linux-gnueabihf
|
|
|
|
- i686-pc-windows-msvc
|
|
|
|
- x86_64-unknown-linux-musl
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
mode:
|
|
|
|
- # debug
|
|
|
|
- --release
|
|
|
|
|
|
|
|
rust_channel:
|
|
|
|
- stable
|
|
|
|
- nightly
|
2020-12-29 23:51:30 +00:00
|
|
|
|
2023-08-21 16:17:06 +00:00
|
|
|
# MSRV: webpki builds and works with Rust 1.47 and later. The
|
|
|
|
# rcgen-based test requires 1.67.0 or later.
|
|
|
|
- 1.67.0
|
2020-12-29 23:51:30 +00:00
|
|
|
|
2020-12-08 04:09:32 +00:00
|
|
|
- beta
|
2020-11-11 04:31:29 +00:00
|
|
|
|
2020-12-02 02:34:18 +00:00
|
|
|
exclude:
|
2020-12-29 23:51:30 +00:00
|
|
|
# 1.46.0 doesn't support `-Clink-self-contained`.
|
2020-12-08 04:09:32 +00:00
|
|
|
- target: x86_64-unknown-linux-musl
|
2020-12-29 23:51:30 +00:00
|
|
|
rust_channel: 1.46.0
|
2020-12-08 04:09:32 +00:00
|
|
|
|
2020-11-11 04:31:29 +00:00
|
|
|
include:
|
|
|
|
- target: arm-unknown-linux-gnueabihf
|
2023-08-30 00:13:59 +00:00
|
|
|
host_os: ubuntu-22.04
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
- target: i686-pc-windows-msvc
|
|
|
|
host_os: windows-latest
|
|
|
|
|
|
|
|
- target: x86_64-unknown-linux-musl
|
2023-08-30 00:13:59 +00:00
|
|
|
host_os: ubuntu-22.04
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
2023-08-30 00:13:59 +00:00
|
|
|
host_os: ubuntu-22.04
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
steps:
|
2020-12-02 02:34:18 +00:00
|
|
|
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
|
|
|
|
run: sudo apt-get update -y
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
|
|
|
run: mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-11-11 04:31:29 +00:00
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
toolchain: ${{ matrix.rust_channel }}
|
|
|
|
|
2020-12-02 02:34:18 +00:00
|
|
|
- if: ${{ matrix.target == 'aarch64-apple-darwin' }}
|
|
|
|
run: echo "DEVELOPER_DIR=/Applications/Xcode_12.2.app/Contents/Developer" >> $GITHUB_ENV
|
|
|
|
|
2020-11-11 04:31:29 +00:00
|
|
|
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
|
|
|
run: |
|
2020-12-02 02:34:18 +00:00
|
|
|
mk/cargo.sh test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
2020-11-11 04:31:29 +00:00
|
|
|
|
|
|
|
- if: ${{ contains(matrix.host_os, 'windows') }}
|
|
|
|
run: |
|
|
|
|
cargo test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
2020-12-02 02:34:18 +00:00
|
|
|
|
2023-10-07 06:08:29 +00:00
|
|
|
# rcgen-based tests require Rust 1.67.
|
|
|
|
- if: ${{ !contains(matrix.host_os, 'windows') && !contains(matrix.rust_channel, '1.61.0') }}
|
|
|
|
run: |
|
|
|
|
mk/cargo.sh test -p rcgen-tests -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
|
|
|
|
|
|
|
# rcgen-based tests require Rust 1.67.
|
|
|
|
- if: ${{ contains(matrix.host_os, 'windows') && !contains(matrix.rust_channel, '1.61.0') }}
|
|
|
|
run: |
|
|
|
|
cargo test -vv -p rcgen-tests --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
|
|
|
|
2020-12-02 02:34:18 +00:00
|
|
|
coverage:
|
|
|
|
runs-on: ${{ matrix.host_os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
features:
|
|
|
|
- --all-features
|
|
|
|
|
|
|
|
# TODO: targets
|
|
|
|
target:
|
|
|
|
- x86_64-unknown-linux-musl
|
|
|
|
|
|
|
|
mode:
|
|
|
|
- # debug
|
|
|
|
|
|
|
|
# Coverage collection is Nightly-only
|
|
|
|
rust_channel:
|
|
|
|
- nightly
|
|
|
|
|
|
|
|
# TODO: targets
|
|
|
|
include:
|
|
|
|
- target: x86_64-unknown-linux-musl
|
2023-08-30 00:13:59 +00:00
|
|
|
host_os: ubuntu-22.04
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
|
|
|
|
run: sudo apt-get update -y
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-checkout@v2
|
2021-04-23 18:00:02 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-12-02 02:34:18 +00:00
|
|
|
|
|
|
|
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
|
|
|
run: RING_COVERAGE=1 mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
|
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/actions-rs-toolchain@v1
|
2020-12-02 02:34:18 +00:00
|
|
|
with:
|
|
|
|
override: true
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
toolchain: ${{ matrix.rust_channel }}
|
|
|
|
|
|
|
|
- if: ${{ matrix.target == 'aarch64-apple-darwin' }}
|
|
|
|
run: echo "DEVELOPER_DIR=/Applications/Xcode_12.2.app/Contents/Developer" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
|
|
|
run: |
|
2023-10-07 06:08:29 +00:00
|
|
|
RING_COVERAGE=1 mk/cargo.sh +${{ matrix.rust_channel }} test --workspace -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
2020-12-02 02:34:18 +00:00
|
|
|
|
2021-04-27 00:48:31 +00:00
|
|
|
- uses: briansmith/codecov-codecov-action@v1
|
2020-12-02 02:34:18 +00:00
|
|
|
with:
|
|
|
|
directory: ./target/${{ matrix.target }}/debug/coverage/reports
|
|
|
|
fail_ci_if_error: true
|
|
|
|
verbose: true
|