fix: updates to c2pa_cbor 0.77.2 #972
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Enforce Tier 1B support tier. | |
| # If you change the supported platforms in this workflow, please also | |
| # update docs/support-tiers.md to match the changes you're making. | |
| # Cool trick: If you want to assess release readiness for any PR, | |
| # add the "check-release" label to the PR. | |
| name: Tier 1B | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - labeled | |
| jobs: | |
| get-features: | |
| name: Get features | |
| runs-on: ubuntu-latest | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| outputs: | |
| rust-native-features: ${{ steps.get-features.outputs.rust-native-features }} | |
| openssl-features: ${{ steps.get-features.outputs.openssl-features }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Get all features | |
| id: get-features | |
| run: | | |
| FEATURES=$(cargo metadata --format-version=1 | jq -r '[.packages[] | select(.name=="c2pa") | .features | keys | map(select(. != "default")) | .[]] | unique | join(" ")') | |
| RUST_NATIVE_FEATURES=$(echo $FEATURES | sed 's/openssl//g') | |
| OPENSSL_FEATURES=$(echo $FEATURES | sed 's/rust_native_crypto//g') | |
| echo "rust-native-features=$RUST_NATIVE_FEATURES" >> "$GITHUB_OUTPUT" | |
| echo "openssl-features=$OPENSSL_FEATURES" >> "$GITHUB_OUTPUT" | |
| tests-openssl: | |
| name: Unit tests (with OpenSSL installed) | |
| needs: get-features | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| rust_version: [stable, 1.88.0] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_version }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| env: | |
| RUST_BACKTRACE: "1" | |
| FEATURES: ${{needs.get-features.outputs.openssl-features}} | |
| run: | | |
| cargo test --features "$FEATURES" | |
| tests-rust-native-crypto: | |
| name: Unit tests (with Rust native crypto installed) | |
| needs: get-features | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| rust_version: [stable, 1.88.0] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_version }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| env: | |
| RUST_BACKTRACE: "1" | |
| FEATURES: ${{needs.get-features.outputs.rust_native_crypto-features}} | |
| run: | | |
| cargo test --features "$FEATURES" | |
| tests-cross: | |
| name: Unit tests | |
| needs: get-features | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [aarch64-unknown-linux-gnu] | |
| rust_version: [stable, 1.88.0] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_version }} | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation toolset | |
| run: cargo install cross | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| # Integration tests are excluded because they require executing | |
| # the compiled binary, which isn't reliably possible when cross-compiling, | |
| # due to architecture mismatch. | |
| - name: Run unit tests (cross build) | |
| env: | |
| FEATURES: ${{needs.get-features.outputs.openssl-features}} | |
| run: | | |
| cross test --lib --bins --features "$FEATURES" --target ${{ matrix.target }} | |
| test-direct-minimal-versions: | |
| name: Unit tests with minimum versions of direct dependencies | |
| needs: get-features | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly-2025-12-06 | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| env: | |
| FEATURES: ${{needs.get-features.outputs.openssl-features}} | |
| run: | | |
| cargo +nightly-2025-12-06 test -Z direct-minimal-versions --all-targets --features "$FEATURES" | |
| unused_deps: | |
| name: Check for unused dependencies | |
| needs: get-features | |
| if: contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'check-release') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly-2025-12-06 | |
| # Pinning to specific nightly build for now. More recent versions | |
| # introduce a lifetime check that creates a whole slew of build | |
| # errors. | |
| - name: Run cargo-udeps | |
| env: | |
| FEATURES: ${{needs.get-features.outputs.openssl-features}} | |
| run: | | |
| mv ./.github/temp-bin/cargo-udeps /home/runner/.cargo/bin/cargo-udeps | |
| cargo udeps --all-targets --features "$FEATURES" | |
| # NOTE: Using pre-built binary as a workaround for | |
| # https://github.com/aig787/cargo-udeps-action/issues/6. |