Skip to content

Commit

Permalink
add scrooge
Browse files Browse the repository at this point in the history
  • Loading branch information
samansmink committed Jun 13, 2024
1 parent 20a81e3 commit 9675ffd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
COMMUNITY_EXTENSION_REF: ${{ steps.parse.outputs.COMMUNITY_EXTENSION_REF }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get all changed description files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
extensions/*/description.yml
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Parse description files
id: parse
env:
Expand All @@ -35,6 +35,7 @@ jobs:
build:
needs: prepare
uses: ./.github/workflows/_extension_distribution.yml
if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME != '' }}
with:
duckdb_version: v1.0.0
extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }}
Expand Down
14 changes: 14 additions & 0 deletions extensions/scrooge/description.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extension:
name: scrooge
description: Provides functionality for financial data-analysis
version: 0.0.1
language: C++
build: cmake
license: MIT
maintainers:
- pdet


repo:
github: pdet/Scrooge-McDuck
ref: 92a24d951fbbc7bbf6f7978726c71871608a8c23
22 changes: 20 additions & 2 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import os
import sys
import yaml

# TODO: check prefix, needs to be in installation dir

desc_files = os.environ['ALL_CHANGED_FILES'].split(' ')
if len(desc_files) != 1:
if 'ALL_CHANGED_FILES' in os.environ:
desc_files = os.environ['ALL_CHANGED_FILES'].split(' ')
else:
desc_files = []

print(f"Files changed: {desc_files}")

if len(desc_files) > 1:
raise ValueError('cannot have multiple descriptors changed or packages with spaces in their names')

if len(desc_files) == 0 or len(desc_files[0]) == 0:
print("No changed files, nothing will be built")
with open('env.sh', 'w+') as hdl:
hdl.write(f"COMMUNITY_EXTENSION_GITHUB=\n")
hdl.write(f"COMMUNITY_EXTENSION_REF=\n")
hdl.write(f"COMMUNITY_EXTENSION_NAME=\n")
sys.exit(os.EX_OK)

desc_file = desc_files[0]
if len(desc_file) == 0:
raise ValueError('description file not found (ALL_CHANGED_FILES was set but empty)')

with open(desc_file, 'r') as stream:
desc = yaml.safe_load(stream)
Expand Down

0 comments on commit 9675ffd

Please sign in to comment.