Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflow #17

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions .github/workflows/release-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,10 @@ jobs:
# Retreive git files
- uses: actions/checkout@v2
# Set cache configuration
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Install cargo
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Show commands
run: |
echo pwd:
Expand Down
75 changes: 16 additions & 59 deletions .github/workflows/validation-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: Rust Validation

env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: "-D warnings --cfg uuid_unstable"
RUSTFLAGS: -D warnings --cfg uuid_unstable -C debuginfo=1
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
Expand All @@ -24,18 +24,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/[email protected]
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo clippy --no-default-features --all-targets -- -D warnings

Expand Down Expand Up @@ -66,33 +58,15 @@ jobs:
run: |
pwd
ls
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/[email protected]
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- run: cargo test

integration:
name: "Integration testing (docker)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
id: cache-cargo
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Docker layers
uses: actions/cache@v2
id: cache-docker
Expand Down Expand Up @@ -142,19 +116,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
id: cache-cargo
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
- env:
# Can't use chrono for time in isolation
MIRIFLAGS: -Zmiri-disable-isolation
Expand All @@ -165,18 +130,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- uses: actions/setup-python@v3
- name: Validate pre-commit
Expand All @@ -187,16 +144,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc


Expand All @@ -209,3 +158,11 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exit-code 1 --ignore lipsum

security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions udf-uuid/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ impl BasicUdf for UuidToBin {
) -> Result<Self::Returns<'a>, ProcessError> {
let input = args.get(0).unwrap().value();
let in_str = input.as_bytes().unwrap();
let Ok(uuid) = Uuid::try_parse_ascii(in_str) else {
return Ok(None)
let Ok(uuid) = Uuid::try_parse_ascii(in_str) else {
return Ok(None);
};

let bytes = uuid.as_bytes();
Expand Down
2 changes: 1 addition & 1 deletion udf-uuid/src/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl BasicUdf for UuidIsValid {
) -> Result<Self::Returns<'a>, ProcessError> {
let input = args.get(0).unwrap().value();
let Some(in_str) = input.as_string() else {
return Ok(0)
return Ok(0);
};

let in_rep = in_str.replace('-', ""); // Remove hyphens
Expand Down
Loading