catch StackOverflowException in deserialization (#46) #85
This file contains 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
name: Publish Release | ||
# copied from Dafny repo | ||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
prerelease: | ||
required: false | ||
type: boolean | ||
sha: | ||
required: true | ||
type: string | ||
draft: | ||
required: true | ||
type: boolean | ||
release_notes: | ||
required: true | ||
type: string | ||
tag_name: | ||
required: true | ||
type: string | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build_and_test_cedar_java_ffi: | ||
name: Rust project - latest | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
toolchain: | ||
- stable | ||
steps: | ||
- name: Checkout cedar-java | ||
uses: actions/checkout@v3 | ||
- name: Checkout cedar | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: cedar-policy/cedar | ||
ref: main | ||
path: ./cedar | ||
- name: rustup | ||
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | ||
- name: cargo fmt | ||
working-directory: ./CedarJavaFFI | ||
run: cargo fmt --all --check | ||
- name: cargo rustc | ||
working-directory: ./CedarJavaFFI | ||
run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose | ||
- name: cargo test | ||
working-directory: ./CedarJavaFFI | ||
run: cargo test --verbose | ||
- name: Build CedarJava | ||
working-directory: ./CedarJava | ||
shell: bash | ||
run: bash config.sh && ./gradlew build | ||
- name: Move libcedar_java_ffi files | ||
working-directory: ./CedarJavaFFI | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
mv target/debug/libcedar_java_ffi.so target/debug/libcedar_java_ffi-${{ inputs.name }}.so | ||
sha1sum target/debug/libcedar_java_ffi-${{ inputs.name }}.so > target/debug/libcedar_java_ffi-${{ inputs.name }}.so.sha1 | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
mv target/debug/libcedar_java_ffi.dylib target/debug/libcedar_java_ffi-${{ inputs.name }}.dylib | ||
sha1sum target/debug/libcedar_java_ffi-${{ inputs.name }}.dylib > target/debug/libcedar_java_ffi-${{ inputs.name }}.dylib.sha1 | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
mv target/debug/libcedar_java_ffi.dll target/debug/libcedar_java_ffi-${{ inputs.name }}.dll | ||
sha1sum target/debug/libcedar_java_ffi-${{ inputs.name }}.dll > target/debug/libcedar_java_ffi-${{ inputs.name }}.dll.sha1 | ||
else | ||
echo "OS did not match" | ||
fi | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: CedarJavaFFI ${{ inputs.name }} | ||
tag_name: ${{ inputs.tag_name }} | ||
body: ${{ inputs.release_notes }} | ||
draft: ${{ inputs.draft }} | ||
prerelease: ${{ inputs.prerelease }} | ||
files: | | ||
./CedarJavaFFI/target/debug/libcedar_java_ffi-${{ inputs.name }}.* | ||
fail_on_unmatched_files: true |