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
4 changes: 3 additions & 1 deletion adbc_drivers_dev/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def build_rust(

env = {}
# Some env vars need to be explicitly propagated into Docker
smuggle_vars = set()
smuggle_vars = {"PROTOC"}

if platform.system() == "Darwin":
# https://doc.rust-lang.org/nightly/rustc/platform-support/apple-darwin.html#os-version
Expand All @@ -363,6 +363,8 @@ def build_rust(
for var in smuggle_vars:
if var in env:
smuggle_env += f'{var}="{shlex.quote(env[var])}" '
elif var in os.environ:
smuggle_env += f'{var}="{shlex.quote(os.environ[var])}" '

command = [
"docker",
Expand Down
22 changes: 22 additions & 0 deletions adbc_drivers_dev/templates/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'

- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -134,6 +136,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% endif %>

<% if lang == "go" %>
Expand Down Expand Up @@ -194,6 +197,8 @@ jobs:
go build ./...
<% elif lang == "rust" %>
cargo build --locked
<% elif lang == "script" %>
./ci/scripts/build.sh test ${{ matrix.platform }} ${{ matrix.arch }}
<% else %>
<{not_implemented(lang)}>
<% endif %>
Expand Down Expand Up @@ -243,6 +248,8 @@ jobs:
go test -tags assert -v ./...
<% elif lang == "rust" %>
cargo test
<% elif lang == "script" %>
./ci/scripts/test.sh ${{ matrix.platform }} ${{ matrix.arch }}
<% else %>
<{not_implemented(lang)}>
<% endif %>
Expand Down Expand Up @@ -290,12 +297,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'

- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -305,6 +314,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% endif %>

<% if lang == "go" %>
Expand Down Expand Up @@ -464,12 +474,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'

- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -479,6 +491,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% endif %>

<% if lang == "go" %>
Expand Down Expand Up @@ -550,12 +563,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'

- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -565,6 +580,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% endif %>

<% if lang == "go" %>
Expand Down Expand Up @@ -675,12 +691,14 @@ jobs:
with:
fetch-depth: 1
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 1
persist-credentials: false
submodules: 'recursive'
- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name == 'workflow_dispatch'
Expand All @@ -689,6 +707,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 1
persist-credentials: false
submodules: 'recursive'
<% endif %>
- name: load package
<% if private or secrets["build:test"] %>
Expand Down Expand Up @@ -748,12 +767,14 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% else %>
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'

- name: "checkout remote"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -763,6 +784,7 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
persist-credentials: false
submodules: 'recursive'
<% endif %>

- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
Expand Down
47 changes: 23 additions & 24 deletions adbc_drivers_dev/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ def generate_workflows(args) -> int:
langs = {
"go": ("Go", "go"),
"rust": ("Rust", "rust"),
"script": ("Custom", "src"),
}

retcode = 0
for lang, (lang_human, lang_subdir) in langs.items():
lang_config = params.lang.get(lang)
if not lang_config:
continue

(args.repository / lang_subdir).mkdir(parents=True, exist_ok=True)

template = env.get_template("test.yaml")
write_workflow(
workflows,
Expand Down Expand Up @@ -153,6 +157,25 @@ def generate_workflows(args) -> int:
},
)

template = env.get_template("pixi.toml")
write_workflow(
args.repository / lang_subdir,
template,
"pixi.toml",
{
**params.to_dict(),
"lang": lang,
"lang_human": lang_human,
"lang_subdir": lang_subdir,
"lang_config": lang_config,
},
)

license_template = args.repository / lang_subdir / "license.tpl"
if not license_template.is_file():
print(f"Missing {license_template}", file=sys.stderr)
retcode = 1

if lang == "go":
template = env.get_template("golangci.toml")
write_workflow(
Expand All @@ -175,30 +198,6 @@ def generate_workflows(args) -> int:
},
)

template = env.get_template("pixi.toml")

retcode = 0
for lang, enabled in params.lang.items():
if not enabled:
continue
write_workflow(
args.repository / lang,
template,
"pixi.toml",
{
**params.to_dict(),
"lang": lang,
"lang_human": lang_human,
"lang_subdir": lang_subdir,
"lang_config": lang_config,
},
)

license_template = args.repository / lang / "license.tpl"
if not license_template.is_file():
print(f"Missing {license_template}", file=sys.stderr)
retcode = 1

return retcode


Expand Down