Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Sep 10, 2023
1 parent f131fa7 commit 77fbbfa
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 72 deletions.
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

0 comments on commit 77fbbfa

Please sign in to comment.