Skip to content

TPE: Use value.get_as_x methods when available #5406

TPE: Use value.get_as_x methods when available

TPE: Use value.get_as_x methods when available #5406

Workflow file for this run

name: Cargo Build & Test
on:
pull_request:
# Declare default permissions as read only.
# Apparently, actions/upload-artifact does not need write permissions.
# See: https://github.com/actions/upload-artifact/issues/197
permissions: read-all
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
uses: ./.github/workflows/build_and_test.yml

Check warning on line 15 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Cargo Build & Test

Workflow syntax warning

In .github/workflows/ci.yml (Line: 15, Col: 11): Error from called workflow cedar-policy/cedar/.github/workflows/build_and_test.yml@835130fb90c5aa1b0350e3703209b1fc763e3be2 (Line: 69, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?

Check warning on line 15 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Cargo Build & Test

Workflow syntax warning

In .github/workflows/ci.yml (Line: 15, Col: 11): Error from called workflow cedar-policy/cedar/.github/workflows/build_and_test.yml@835130fb90c5aa1b0350e3703209b1fc763e3be2 (Line: 103, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
with:
collect_coverage: true
check_coverage:
name: Check coverage criteria
needs: build_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/create_coverage_comment
with:
threshold: 0.8
cargo_semver_checks:
name: Cargo SemVer Checks
runs-on: ubuntu-latest
# Make this check mandatory for release branches.
continue-on-error: ${{ !startsWith(github.base_ref, 'release/') }}
strategy:
matrix:
toolchain:
- stable
steps:
- name: Check out head (${{ github.head_ref }})
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: head
# Pull requests to non-release branches are checked for SemVer breakage
# relative to their target branch.
- if: ${{ !startsWith(github.base_ref, 'release/') }}
name: Check out base (${{ github.base_ref }})
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.base_ref }}
path: base
# If this is a release PR, check SemVer relative to the highest version
# published to crates.io <= the version from head.
- if: ${{ startsWith(github.base_ref, 'release/') }}
name: Check out base (from crates.io)
run: head/.github/scripts/check-out-base-from-crates-io.sh
shell: bash
# `cargo semver-checks` doesn't understand `rlib` crates.
- run: >-
sed -i -E 's/^(crate-type = \["rlib", "cdylib"\]|crate-type = \["rlib"\])$/crate-type = ["lib"]/' {head,base}/cedar-policy/Cargo.toml
- run: sudo apt-get update && sudo apt-get install protobuf-compiler
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo install cargo-semver-checks --locked
- run: cargo semver-checks check-release --package cedar-policy --baseline-root ../base
working-directory: head