Skip to content

Commit

Permalink
added CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyshazam committed Feb 6, 2024
1 parent b8bdf4d commit 4989bf6
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 31 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
ignore:
# arrow and datafusion are bumped manually
- dependency-name: "arrow*"
update-types: ["version-update:semver-major"]
76 changes: 76 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- "releases/*"

jobs:
build-lint-test:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-arm]
include:
- os: windows-latest
checkTarget: true
- os: ubuntu-latest
docsTarget: true
cloudTestTarget: true
- os: ubuntu-arm
runsOn: buildjet-4vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src/DeltaLake/Bridge

- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Build
# We intentionally just build debug mode in this CI. We build before
# regen to confirm no interop header changes.
run: dotnet build

- name: Regen confirm unchanged
if: ${{ matrix.checkTarget }}
# Needs to be 16.0.0 until https://github.com/dotnet/ClangSharp/pull/506 released
run: |
dotnet tool install --global --version 16.0.0 ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
npx doctoc README.md
git config --global core.safecrlf false
git diff --exit-code
- name: Check format
if: ${{ matrix.checkTarget }}
run: dotnet format --verify-no-changes

- name: Test
run: dotnet test --logger "console;verbosity=detailed" --blame-crash -v n

- name: Upload test failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: test-fail-${{ matrix.os }}
path: tests/DeltaLake.Tests/TestResults

- name: Build docs
if: ${{ matrix.docsTarget }}
run: |
dotnet tool update -g docfx
docfx src/DeltaLake.ApiDoc/docfx.json --warningsAsErrors
4 changes: 4 additions & 0 deletions src/DeltaLake.ApiDoc/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# API Documentation

- [DeltaLake.Table](/api/DeltaLake.Table.html) - The delta table class and options
- [DeltaLake.Runtime](/api/DeltaLake.Runtime.html) - The runtime and options
51 changes: 51 additions & 0 deletions src/DeltaLake.ApiDoc/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"metadata": [
{
"src": [
{
"files": ["DeltaLake/*.csproj"],
"exclude": ["**/bin/**", "**/obj/**"],
"src": ".."
}
],
"dest": "api",
"includePrivateMembers": false,
"disableGitFeatures": false,
"disableDefaultFilter": false,
"noRestore": false,
"namespaceLayout": "nested",
"memberLayout": "samePage",
"allowCompilationErrors": false
}
],
"build": {
"content": [
{
"files": ["api/**.yml", "api/index.md"]
},
{
"files": ["*.md"]
}
],
"resource": [
{
"files": []
}
],
"globalMetadata": {
"_appFaviconPath": "favicon.ico",
"_appFooter": "<span></span>",
"_appName": "DeltaLake .NET SDK",
"_appTitle": "DeltaLake .NET SDK",
"_enableSearch": false,
"_disableContribution": true
},
"output": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": ["default", "modern"],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": false
}
}
10 changes: 10 additions & 0 deletions src/DeltaLake.ApiDoc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Home
---

# DeltaLake .NET SDK

See:

- [GitHub Repository](https://github.com/mightyshazam/delta-dotnet)
- [API Documentation](/api/)
1 change: 0 additions & 1 deletion src/DeltaLake/Bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/DeltaLake/Bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ arrow = { version = "50", features = ["ffi"]}
chrono = "0.4.31"
# deltalake = "0.16.5"
deltalake = { git = "https://github.com/delta-io/delta-rs.git", branch = "main", features = ["azure", "gcs", "s3", "datafusion"] }
flatbuffers = "23.5.26"
futures = "0.3"
libc = "0.2"
serde_json = "1.0.111"
Expand Down
31 changes: 2 additions & 29 deletions src/DeltaLake/Bridge/src/schema.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use deltalake::arrow::{
datatypes::Schema as ArrowSchema,
ipc::convert::{schema_to_fb_offset, try_schema_from_flatbuffer_bytes},
};
use flatbuffers::FlatBufferBuilder;
use deltalake::arrow::datatypes::Schema as ArrowSchema;

use crate::{error::DeltaTableError, runtime::Runtime, ByteArray, ByteArrayRef};
use crate::{error::DeltaTableError, ByteArrayRef};

#[repr(C)]
pub enum PartitionFilterBinaryOp {
Expand Down Expand Up @@ -85,26 +81,3 @@ pub(crate) fn get_schema(
})?;
Ok(arrow_schema)
}

pub(crate) fn serialize_schema(runtime: &mut Runtime, schema: &ArrowSchema) -> (Vec<u8>, usize) {
let buffer = runtime.borrow_buf();
let mut fbb = FlatBufferBuilder::from_vec(buffer);
let root = schema_to_fb_offset(&mut fbb, schema);
fbb.finish(root, None);

let (buffer, offset) = fbb.collapse();
(buffer, offset)
}

pub(crate) fn deserialize_schema(
runtime: &mut Runtime,
bytes: &[u8],
) -> Result<ArrowSchema, DeltaTableError> {
try_schema_from_flatbuffer_bytes(bytes).map_err(|err| {
DeltaTableError::new(
runtime,
crate::error::DeltaTableErrorCode::Arrow,
&err.to_string(),
)
})
}

0 comments on commit 4989bf6

Please sign in to comment.