Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Jan 31, 2024
1 parent a5ebaf4 commit eda01e6
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 169 deletions.
84 changes: 0 additions & 84 deletions .github/workflows/Linux.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/MacOS.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# This workflow calls the main distribution pipeline from DuckDB to build, test and (optionally) release the extension
#
name: Main Extension Distribution Pipeline
on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
cancel-in-progress: true

jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@5b391512a8fc7800a0c22d98714e6d8f25c002cf
with:
extension_name: arrow
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64;windows_amd64_rtools'
duckdb_version: v0.9.2

duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: ./.github/workflows/_extension_deploy.yml
secrets: inherit
with:
extension_name: arrow
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64;windows_amd64_rtools'
duckdb_version: v0.9.2
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
23 changes: 15 additions & 8 deletions .github/workflows/NodeJS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,28 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'true'

- uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Update DuckDB submodule
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install required node packages
run: |
git config --global --add safe.directory '*'
make pull
sudo npm install -g duckdb apache-arrow mocha
sudo npm install duckdb apache-arrow mocha
npm -v
node -v
- name: Install Node
- name: Build duckdb
run: |
cd duckdb
source scripts/install_node.sh 16
make
- name: Build & Test
- name: Run JS tests
run: |
make test_debug_js
make test_release_js
121 changes: 121 additions & 0 deletions .github/workflows/_extension_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#
# Reusable workflow that deploys the artifacts produced by github.com/duckdb/duckdb/.github/workflows/_extension_distribution.yml
#
# note: this workflow needs to be located in the extension repository, as it requires secrets to be passed to the
# deploy script. However, it should generally not be necessary to modify this workflow in your extension repository, as
# this workflow can be configured to use a custom deploy script.


name: Extension Deployment
on:
workflow_call:
inputs:
# The name of the extension
extension_name:
required: true
type: string
# DuckDB version to build against
duckdb_version:
required: true
type: string
# ';' separated list of architectures to exclude, for example: 'linux_amd64;osx_arm64'
exclude_archs:
required: false
type: string
default: ""
# Whether to upload this deployment as the latest. This may overwrite a previous deployment.
deploy_latest:
required: false
type: boolean
default: false
# Whether to upload this deployment under a versioned path. These will not be deleted automatically
deploy_versioned:
required: false
type: boolean
default: false
# Postfix added to artifact names. Can be used to guarantee unique names when this workflow is called multiple times
artifact_postfix:
required: false
type: string
default: ""
# Override the default deploy script with a custom script
deploy_script:
required: false
type: string
default: "./scripts/extension-upload.sh"
# Override the default matrix parse script with a custom script
matrix_parse_script:
required: false
type: string
default: "./duckdb/scripts/modify_distribution_matrix.py"

jobs:
generate_matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
deploy_matrix: ${{ steps.parse-matrices.outputs.deploy_matrix }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'

- name: Checkout DuckDB to version
run: |
cd duckdb
git checkout ${{ inputs.duckdb_version }}
- id: parse-matrices
run: |
python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --deploy_matrix --output deploy_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
deploy_matrix="`cat deploy_matrix.json`"
echo deploy_matrix=$deploy_matrix >> $GITHUB_OUTPUT
echo `cat $GITHUB_OUTPUT`
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: generate_matrix
if: ${{ needs.generate_matrix.outputs.deploy_matrix != '{}' && needs.generate_matrix.outputs.deploy_matrix != '' }}
strategy:
matrix: ${{fromJson(needs.generate_matrix.outputs.deploy_matrix)}}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'

- name: Checkout DuckDB to version
run: |
cd duckdb
git checkout ${{ inputs.duckdb_version }}
- uses: actions/download-artifact@v2
with:
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
path: |
/tmp/extension
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DEPLOY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DEPLOY_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.S3_REGION }}
BUCKET_NAME: ${{ secrets.S3_BUCKET }}
DUCKDB_EXTENSION_SIGNING_PK: ${{ secrets.DUCKDB_EXTENSION_SIGNING_PK }}
run: |
pwd
python3 -m pip install pip awscli
git config --global --add safe.directory '*'
cd duckdb
git fetch --tags
export DUCKDB_VERSION=`git tag --points-at HEAD`
export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`}
cd ..
git fetch --tags
export EXT_VERSION=`git tag --points-at HEAD`
export EXT_VERSION=${EXT_VERSION:=`git log -1 --format=%h`}
${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ release:
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} ${CMAKE_VARS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Release ${BUILD_FLAGS} -S ./duckdb/ -B build/release && \
cmake --build build/release --config Release

# Client build
debug_js: CLIENT_FLAGS=-DBUILD_NODE=1
debug_js: debug
release_js: CLIENT_FLAGS=-DBUILD_NODE=1
release_js: release

# Main tests
test: test_release

Expand All @@ -74,11 +68,11 @@ test_debug: debug
# Client tests
DEBUG_EXT_PATH='$(PROJ_DIR)build/debug/extension/arrow/arrow.duckdb_extension'
RELEASE_EXT_PATH='$(PROJ_DIR)build/release/extension/arrow/arrow.duckdb_extension'
test_js: test_debug_js
test_debug_js: debug_js
cd duckdb/tools/nodejs && ARROW_EXTENSION_BINARY_PATH=$(DEBUG_EXT_PATH) npm run test-path -- "../../../test/nodejs/**/*.js"
test_release_js: release_js
cd duckdb/tools/nodejs && ARROW_EXTENSION_BINARY_PATH=$(RELEASE_EXT_PATH) npm run test-path -- "../../../test/nodejs/**/*.js"
test_js:
test_debug_js:
ARROW_EXTENSION_BINARY_PATH=$(DEBUG_EXT_PATH) mocha -R spec --timeout 480000 -n expose-gc --exclude 'test/*.ts' -- "test/nodejs/**/*.js"
test_release_js:
ARROW_EXTENSION_BINARY_PATH=$(RELEASE_EXT_PATH) mocha -R spec --timeout 480000 -n expose-gc --exclude 'test/*.ts' -- "test/nodejs/**/*.js"

format:
find src/ -iname *.hpp -o -iname *.cpp | xargs clang-format --sort-includes=0 -style=file -i
Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 413 files
6 changes: 3 additions & 3 deletions test/nodejs/arrow_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var duckdb = require('../../duckdb/tools/nodejs');
var arrow = require('../../duckdb/tools/nodejs/node_modules/apache-arrow')
var arrow = require('apache-arrow')
var duckdb = require('duckdb');
var assert = require('assert');

const parquet_file_path = "../../../data/parquet-testing/lineitem_sf0_01.parquet";
const parquet_file_path = "data/parquet-testing/lineitem_sf0_01.parquet";

// Wrapper for tests, materializes whole stream
const arrow_ipc_stream = async (conn, sql) => {
Expand Down

0 comments on commit eda01e6

Please sign in to comment.