Skip to content

fix(picky): don't panic on RFC 3161 timestamp fallback #1211

fix(picky): don't panic on RFC 3161 timestamp fallback

fix(picky): don't panic on RFC 3161 timestamp fallback #1211

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check formatting
run: |
Write-Host "Check formatting"
cargo fmt --all -- --check
if ($LastExitCode -eq 1) {
throw "Bad formatting, please run 'cargo +stable fmt --all'"
}
cargo fmt --manifest-path ./ffi/wasm/Cargo.toml -- --check
if ($LastExitCode -eq 1) {
throw "Bad formatting, please run 'cargo +stable fmt --manifest-path ./ffi/wasm/Cargo.toml'"
}
shell: pwsh
lints:
name: Lints [${{ matrix.os }}]
needs: [formatting]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run clippy
run: cargo clippy --locked --workspace --all-features --all-targets -- -D warnings
lints-wasm:
name: Lints [wasm]
needs: [formatting]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run clippy
run: cargo clippy --locked --all-features --all-targets --manifest-path ./ffi/wasm/Cargo.toml -- -D warnings
- name: Lint picky-ava-tests
run: |
Set-Location ./ffi/wasm/ava_tests
npm install
npm run ci
shell: pwsh
tests:
name: Tests [${{ matrix.os }}]
needs: [formatting]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run tests
run: cargo test --locked --verbose --workspace --all-features
msrv:
# Minimum supported Rust version check for published crates.
# If this break, bump crate version minor number.
# See https://github.com/Devolutions/picky-rs/issues/89
name: Check MSRV [${{ matrix.crate }}]
needs: [formatting]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate: [ picky-asn1, picky-asn1-der, picky-asn1-x509, picky ]
include:
- crate: picky-asn1
msvc: "1.85"
- crate: picky-asn1-der
msvc: "1.85"
- crate: picky-asn1-x509
msvc: "1.85"
- crate: picky
msvc: "1.85"
steps:
- uses: actions/checkout@v6
- name: Configure runner
run: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${{ matrix.msvc }}
- name: cargo check ${{ matrix.crate }}
run: cargo +${{ matrix.msvc }} check -p ${{ matrix.crate }}
dotnet-tests:
name: .NET binding tests
needs: [formatting]
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
# The .NET bindings are compatible up to .NET 6 SDK.
# We run the tests of the oldest compatible framework.
- name: Install .NET 6 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
# Release matches what ships (the ffi-production/NuGet build).
# Furthermore, debug builds currently trip std precondition checks at the FFI boundary.
# FIXME/TODO: Once we updated Diplomat to a newer version, it’s worth switching to a matrix
# for testing both the debug and release builds.
# NOTE: support for netstandard2.0 will be dropped once we get rid of the specialized Diplomat fork.
- name: Build native library
run: cargo build --locked --release -p picky-ffi
shell: pwsh
# Devolutions.Picky multi-targets net9.0-ios, so the iOS workload is required
# just to build it.
- name: Install iOS workload
run: dotnet workload install ios
shell: pwsh
# GeneratePackageOnBuild is on by default; disable it so the build does not try to
# pack native libraries for every RID (only the win-x64 one is available here).
# The committed bindings are built as-is (not regenerated) so a stale binding fails CI.
- name: Build .NET bindings and tests
run: dotnet build ./ffi/dotnet/Devolutions.Picky.Tests/Devolutions.Picky.Tests.csproj -c Release -p:GeneratePackageOnBuild=false
shell: pwsh
# The project intentionally does not copy the native lib to output
# (CopyToOutputDirectory=Never), so manually place it next to the test host.
- name: Place native library next to the test host
run: |
$testDll = Get-ChildItem -Recurse -Path ./ffi/dotnet/Devolutions.Picky.Tests/bin/Release -Filter Devolutions.Picky.Tests.dll | Select-Object -First 1
Copy-Item ./target/release/picky.dll (Join-Path $testDll.DirectoryName DevolutionsPicky.dll) -Force
shell: pwsh
# The tests read fixtures via paths relative to the test host CWD that resolve to
# <repo-parent>/test_assets; provision them from picky-test-data.
# FIXME: It would be worth repointing them at picky-test-data/test_assets.
- name: Provision test assets
run: Copy-Item picky-test-data/test_assets ../test_assets -Recurse -Force
shell: pwsh
- name: Run .NET tests
run: dotnet test ./ffi/dotnet/Devolutions.Picky.Tests/Devolutions.Picky.Tests.csproj -c Release --no-build
shell: pwsh
success:
name: Success
if: ${{ always() }}
needs: [formatting, lints, lints-wasm, tests, msrv, dotnet-tests]
runs-on: ubuntu-latest
steps:
- name: CI succeeded
id: succeeded
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0
- name: CI failed
if: ${{ steps.succeeded.outcome == 'skipped' }}
run: exit 1