mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
build: Check-in Cargo.lock files and lockdown .net (#384)
Use frozen and locked builds Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
2858b63cd4
commit
c28bde3f56
22
.github/workflows/pr.yml
vendored
22
.github/workflows/pr.yml
vendored
@@ -18,24 +18,26 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Format Check
|
- name: Format Check
|
||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
|
- name: Fetch
|
||||||
|
run: cargo fetch
|
||||||
- name: Build (all features)
|
- name: Build (all features)
|
||||||
run: cargo build -r --all-features
|
run: cargo build -r --all-features --frozen
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build -r
|
run: cargo build -r --frozen
|
||||||
- name: Test no_std
|
- name: Test no_std
|
||||||
run: cargo test -r --no-default-features
|
run: cargo test -r --no-default-features --frozen
|
||||||
- name: Build only std
|
- name: Build only std
|
||||||
run: cargo build -r --example regorus --no-default-features --features "std"
|
run: cargo build -r --example regorus --no-default-features --features "std" --frozen
|
||||||
- name: Doc Tests
|
- name: Doc Tests
|
||||||
run: cargo test -r --doc
|
run: cargo test -r --doc --frozen
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test -r
|
run: cargo test -r --frozen
|
||||||
- name: Run example
|
- name: Run example
|
||||||
run: cargo run --example regorus -- eval -d examples/server/allowed_server.rego -i examples/server/input.json data.example
|
run: cargo run --example regorus --frozen -- eval -d examples/server/allowed_server.rego -i examples/server/input.json data.example
|
||||||
- name: Run tests (ACI)
|
- name: Run tests (ACI)
|
||||||
run: cargo test -r --test aci
|
run: cargo test -r --test aci --frozen
|
||||||
- name: Run tests (KATA)
|
- name: Run tests (KATA)
|
||||||
run: cargo test -r --test kata
|
run: cargo test -r --test kata --frozen
|
||||||
- name: Run tests (OPA Conformance)
|
- name: Run tests (OPA Conformance)
|
||||||
run: >-
|
run: >-
|
||||||
cargo test -r --test opa --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing)
|
cargo test -r --test opa --frozen --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing)
|
||||||
|
|||||||
3
.github/workflows/publish-java.yml
vendored
3
.github/workflows/publish-java.yml
vendored
@@ -48,7 +48,8 @@ jobs:
|
|||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
- if: ${{ matrix.build_cmd == 'zigbuild' }}
|
- if: ${{ matrix.build_cmd == 'zigbuild' }}
|
||||||
run: pip install cargo-zigbuild
|
run: pip install cargo-zigbuild
|
||||||
- run: cargo ${{ matrix.build_cmd || 'build' }} --release --target ${{ matrix.target }}${{ matrix.glibc && format('.{0}', matrix.glibc) || '' }} --manifest-path ./bindings/java/Cargo.toml
|
- run: cargo fetch
|
||||||
|
- run: cargo ${{ matrix.build_cmd || 'build' }} --release --frozen --target ${{ matrix.target }}${{ matrix.glibc && format('.{0}', matrix.glibc) || '' }} --manifest-path ./bindings/java/Cargo.toml
|
||||||
- run: mkdir -p native/${{ matrix.target }}
|
- run: mkdir -p native/${{ matrix.target }}
|
||||||
- run: mv target/${{ matrix.target }}/release/*.${{ matrix.extension }} ./native/${{ matrix.target }}/
|
- run: mv target/${{ matrix.target }}/release/*.${{ matrix.extension }} ./native/${{ matrix.target }}/
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
|||||||
4
.github/workflows/rust-clippy.yml
vendored
4
.github/workflows/rust-clippy.yml
vendored
@@ -40,11 +40,15 @@ jobs:
|
|||||||
- name: Install required cargo
|
- name: Install required cargo
|
||||||
run: cargo install clippy-sarif sarif-fmt
|
run: cargo install clippy-sarif sarif-fmt
|
||||||
|
|
||||||
|
- name: Fetch
|
||||||
|
run: cargo fetch
|
||||||
|
|
||||||
- name: Run rust-clippy
|
- name: Run rust-clippy
|
||||||
run:
|
run:
|
||||||
cargo clippy
|
cargo clippy
|
||||||
--all-features
|
--all-features
|
||||||
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
|
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
|
||||||
|
--frozen
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Upload analysis results to GitHub
|
- name: Upload analysis results to GitHub
|
||||||
|
|||||||
3
.github/workflows/test-c-cpp.yml
vendored
3
.github/workflows/test-c-cpp.yml
vendored
@@ -20,7 +20,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Workaround to ensure that regorus.h is generated
|
- name: Workaround to ensure that regorus.h is generated
|
||||||
run: |
|
run: |
|
||||||
cargo build -r
|
cargo fetch
|
||||||
|
cargo build -r --frozen
|
||||||
working-directory: ./bindings/ffi
|
working-directory: ./bindings/ffi
|
||||||
|
|
||||||
- name: Test c binding
|
- name: Test c binding
|
||||||
|
|||||||
10
.github/workflows/test-csharp.yml
vendored
10
.github/workflows/test-csharp.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Build Regorus binding
|
- name: Build Regorus binding
|
||||||
run: cargo build -r --target ${{ matrix.runtime.target }}
|
run: cargo build -r --target ${{ matrix.runtime.target }} --locked
|
||||||
working-directory: ./bindings/ffi
|
working-directory: ./bindings/ffi
|
||||||
|
|
||||||
- name: Upload regorus ffi shared library
|
- name: Upload regorus ffi shared library
|
||||||
@@ -58,6 +58,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-dotnet@v4
|
- uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
global-json-file: ./bindings/csharp/global.json
|
||||||
|
|
||||||
|
- run: echo '${{ steps.stepid.outputs.dotnet-version }}'
|
||||||
|
|
||||||
- name: Download regorus ffi shared libraries
|
- name: Download regorus ffi shared libraries
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -108,6 +112,10 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/setup-dotnet@v4
|
- uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
global-json-file: ./bindings/csharp/global.json
|
||||||
|
|
||||||
|
- run: echo '${{ steps.stepid.outputs.dotnet-version }}'
|
||||||
|
|
||||||
- name: Download regorus nuget
|
- name: Download regorus nuget
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|||||||
3
.github/workflows/test-ffi.yml
vendored
3
.github/workflows/test-ffi.yml
vendored
@@ -17,6 +17,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Test FFI
|
- name: Test FFI
|
||||||
run: |
|
run: |
|
||||||
cargo build -r
|
cargo fetch
|
||||||
|
cargo build -r --frozen
|
||||||
cargo clippy --all-targets --no-deps -- -Dwarnings
|
cargo clippy --all-targets --no-deps -- -Dwarnings
|
||||||
working-directory: ./bindings/ffi
|
working-directory: ./bindings/ffi
|
||||||
|
|||||||
2
.github/workflows/test-java.yml
vendored
2
.github/workflows/test-java.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Building binding
|
- name: Building binding
|
||||||
run: |
|
run: |
|
||||||
cargo clippy --all-targets --no-deps -- -Dwarnings
|
cargo clippy --all-targets --no-deps -- -Dwarnings
|
||||||
cargo build --release --manifest-path bindings/java/Cargo.toml
|
cargo build --release --manifest-path bindings/java/Cargo.toml --locked
|
||||||
|
|
||||||
- name: Build jar
|
- name: Build jar
|
||||||
run: mvn package
|
run: mvn package
|
||||||
|
|||||||
12
.github/workflows/test-musl.yml
vendored
12
.github/workflows/test-musl.yml
vendored
@@ -20,14 +20,16 @@ jobs:
|
|||||||
run: rustup target add x86_64-unknown-linux-musl
|
run: rustup target add x86_64-unknown-linux-musl
|
||||||
- name: Install musl-gcc
|
- name: Install musl-gcc
|
||||||
run: sudo apt update && sudo apt install -y musl-tools
|
run: sudo apt update && sudo apt install -y musl-tools
|
||||||
|
- name: Fetch
|
||||||
|
run: cargo fetch
|
||||||
- name: Build (MUSL)
|
- name: Build (MUSL)
|
||||||
run: cargo build --verbose --all-targets --target x86_64-unknown-linux-musl
|
run: cargo build --verbose --all-targets --target x86_64-unknown-linux-musl --frozen
|
||||||
- name: Run tests (MUSL)
|
- name: Run tests (MUSL)
|
||||||
run: cargo test -r --verbose --target x86_64-unknown-linux-musl
|
run: cargo test -r --verbose --target x86_64-unknown-linux-musl --frozen
|
||||||
- name: Run tests (MUSL ACI)
|
- name: Run tests (MUSL ACI)
|
||||||
run: cargo test -r --test aci --target x86_64-unknown-linux-musl
|
run: cargo test -r --test aci --target x86_64-unknown-linux-musl --frozen
|
||||||
- name: Run tests (KATA ACI)
|
- name: Run tests (KATA ACI)
|
||||||
run: cargo test -r --test kata --target x86_64-unknown-linux-musl
|
run: cargo test -r --test kata --target x86_64-unknown-linux-musl --frozen
|
||||||
- name: Run tests (MUSL OPA Conformance)
|
- name: Run tests (MUSL OPA Conformance)
|
||||||
run: >-
|
run: >-
|
||||||
cargo test -r --test opa --features opa-testutil,serde_json/arbitrary_precision --target x86_64-unknown-linux-musl -- $(tr '\n' ' ' < tests/opa.passing)
|
cargo test -r --test opa --frozen --features opa-testutil,serde_json/arbitrary_precision --target x86_64-unknown-linux-musl -- $(tr '\n' ' ' < tests/opa.passing)
|
||||||
|
|||||||
4
.github/workflows/test-no-std.yml
vendored
4
.github/workflows/test-no-std.yml
vendored
@@ -18,7 +18,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Add no_std target
|
- name: Add no_std target
|
||||||
run: rustup target add thumbv7m-none-eabi
|
run: rustup target add thumbv7m-none-eabi
|
||||||
|
- name: Fetch
|
||||||
|
run: cargo fetch
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build -r --target thumbv7m-none-eabi
|
run: cargo build -r --target thumbv7m-none-eabi --frozen
|
||||||
working-directory: ./tests/ensure_no_std
|
working-directory: ./tests/ensure_no_std
|
||||||
|
|
||||||
|
|||||||
1
.github/workflows/test-wasm.yml
vendored
1
.github/workflows/test-wasm.yml
vendored
@@ -26,6 +26,7 @@ jobs:
|
|||||||
- name: Test wasm binding
|
- name: Test wasm binding
|
||||||
run: |
|
run: |
|
||||||
cd bindings/wasm
|
cd bindings/wasm
|
||||||
|
cargo fetch
|
||||||
cargo clippy --all-targets --no-deps -- -Dwarnings
|
cargo clippy --all-targets --no-deps -- -Dwarnings
|
||||||
wasm-pack build --target nodejs --release
|
wasm-pack build --target nodejs --release
|
||||||
# Enable when upstream issue is fixed.
|
# Enable when upstream issue is fixed.
|
||||||
|
|||||||
20
.github/workflows/tests-debug.yml
vendored
20
.github/workflows/tests-debug.yml
vendored
@@ -16,22 +16,24 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Fetch
|
||||||
|
run: cargo fetch
|
||||||
- name: Build (all features)
|
- name: Build (all features)
|
||||||
run: cargo build --all-features
|
run: cargo build --all-features --frozen
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build
|
run: cargo build --frozen
|
||||||
- name: Test no_std
|
- name: Test no_std
|
||||||
run: cargo test --no-default-features
|
run: cargo test --no-default-features --frozen
|
||||||
- name: Build only std
|
- name: Build only std
|
||||||
run: cargo build --example regorus --no-default-features --features "std"
|
run: cargo build --example regorus --no-default-features --features "std" --frozen
|
||||||
- name: Doc Tests
|
- name: Doc Tests
|
||||||
run: cargo test --doc
|
run: cargo test --doc --frozen
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test
|
run: cargo test --frozen
|
||||||
- name: Run tests (ACI)
|
- name: Run tests (ACI)
|
||||||
run: cargo test --test aci
|
run: cargo test --test aci --frozen
|
||||||
- name: Run tests (KATA)
|
- name: Run tests (KATA)
|
||||||
run: cargo test --test kata
|
run: cargo test --test kata --frozen
|
||||||
- name: Run tests (OPA Conformance)
|
- name: Run tests (OPA Conformance)
|
||||||
run: >-
|
run: >-
|
||||||
cargo test --test opa --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing)
|
cargo test --test opa --frozen --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing)
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -4,10 +4,6 @@
|
|||||||
**/wheels/
|
**/wheels/
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
|
|||||||
1812
Cargo.lock
generated
Normal file
1812
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,8 @@ corrosion_import_crate(
|
|||||||
# See regorus/opa_no_std
|
# See regorus/opa_no_std
|
||||||
FEATURES "custom_allocator,regorus/semver"
|
FEATURES "custom_allocator,regorus/semver"
|
||||||
|
|
||||||
|
LOCKED
|
||||||
|
|
||||||
# Link statically
|
# Link statically
|
||||||
CRATE_TYPES staticlib FLAGS --crate-type=staticlib
|
CRATE_TYPES staticlib FLAGS --crate-type=staticlib
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ corrosion_import_crate(
|
|||||||
# Select specific features in regorus.
|
# Select specific features in regorus.
|
||||||
FEATURES "regorus/semver"
|
FEATURES "regorus/semver"
|
||||||
|
|
||||||
|
LOCKED
|
||||||
|
|
||||||
# Link statically
|
# Link statically
|
||||||
CRATE_TYPES "cdylib"
|
CRATE_TYPES "cdylib"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ corrosion_import_crate(
|
|||||||
# Select specific features in regorus.
|
# Select specific features in regorus.
|
||||||
FEATURES "regorus/semver"
|
FEATURES "regorus/semver"
|
||||||
|
|
||||||
|
LOCKED
|
||||||
|
|
||||||
# Link statically
|
# Link statically
|
||||||
CRATE_TYPES "cdylib")
|
CRATE_TYPES "cdylib")
|
||||||
|
|
||||||
|
|||||||
10
bindings/csharp/global.json
Normal file
10
bindings/csharp/global.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"msbuild-sdks": {
|
||||||
|
"Microsoft.Build.NoTargets": "3.7.56"
|
||||||
|
},
|
||||||
|
"sdk": {
|
||||||
|
"allowPrerelease": false,
|
||||||
|
"version": "8.0.407",
|
||||||
|
"rollForward": "disable"
|
||||||
|
}
|
||||||
|
}
|
||||||
1805
bindings/ffi/Cargo.lock
generated
Normal file
1805
bindings/ffi/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1706
bindings/java/Cargo.lock
generated
Normal file
1706
bindings/java/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1672
bindings/python/Cargo.lock
generated
Normal file
1672
bindings/python/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1718
bindings/ruby/Cargo.lock
generated
Normal file
1718
bindings/ruby/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1662
bindings/wasm/Cargo.lock
generated
Normal file
1662
bindings/wasm/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user