Skip to content
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
60 changes: 55 additions & 5 deletions adbc_drivers_dev/templates/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,34 @@ jobs:
<{not_implemented(lang)}>
<% endif %>

if [[ -f ci/scripts/post-test.sh ]]; then
./ci/scripts/post-test.sh
<% if file_exists("ci/scripts/post-test.sh") %>
- name: Post-Test
if: always()
<% if secrets["test"] %>
env:
<% for name, val in secrets["test"].items() %>
<{name}>: ${{ secrets.<{val}> }} # zizmor: ignore[secrets-outside-env]
<% endfor %>
<% endif %>
working-directory: <{ lang_subdir }>
run: |
set -a
if [[ -f .env ]]; then
source .env
fi
if [[ -f .env.${{ matrix.platform }} ]]; then
source .env.${{ matrix.platform }}
fi
if [[ -f .env.ci ]]; then
source .env.ci
fi
if [[ -f .env.override ]]; then
source .env.override
fi
set +a

./ci/scripts/post-test.sh
<% endif %>

<% if lang == "go" %>
- name: go mod tidy
Expand Down Expand Up @@ -473,11 +498,36 @@ jobs:
pixi run validate
fi

if [[ -f ci/scripts/post-test.sh ]]; then
./ci/scripts/post-test.sh
cp validation-report.xml validation-report-${{ matrix.vendor_version }}.xml

<% if file_exists("ci/scripts/post-test.sh") %>
- name: Post-Test
if: always()
<% if secrets["validate"] %>
env:
<% for name, val in secrets["validate"].items() %>
<{name}>: ${{ secrets.<{val}> }} # zizmor: ignore[secrets-outside-env]
<% endfor %>
<% endif %>
working-directory: <{ lang_subdir }>
run: |
set -a
if [[ -f .env ]]; then
source .env
fi
if [[ -f .env.${{ matrix.platform }} ]]; then
source .env.${{ matrix.platform }}
fi
if [[ -f .env.ci ]]; then
source .env.ci
fi
if [[ -f .env.override ]]; then
source .env.override
fi
set +a

cp validation-report.xml validation-report-${{ matrix.vendor_version }}.xml
./ci/scripts/post-test.sh
<% endif %>

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
6 changes: 6 additions & 0 deletions adbc_drivers_dev/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def template_not_implemented(message: str) -> str:
raise NotImplementedError(message)


def file_exists(root: Path, path: str) -> bool:
return (root / path).is_file()


def generate_workflows(args) -> int:
env = jinja2.Environment(
loader=jinja2.PackageLoader("adbc_drivers_dev"),
Expand Down Expand Up @@ -133,6 +137,7 @@ def generate_workflows(args) -> int:
if lang == "go"
else langs["go"][1]
)
lang_file_exists = functools.partial(file_exists, args.repository / lang_subdir)
lang_ctx = {
"lang": lang,
"lang_human": lang_human,
Expand All @@ -142,6 +147,7 @@ def generate_workflows(args) -> int:
"go_mod_path": go_mod_path,
"lang_config": lang_config,
"lang_tools": lang_tools,
"file_exists": lang_file_exists,
}

write_workflow(
Expand Down