-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
1,773 additions
and
659 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: Release | ||
about: Release a new version of dbt-spark | ||
title: '' | ||
labels: release | ||
assignees: '' | ||
|
||
--- | ||
|
||
### TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
# python dependencies | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
rebase-strategy: "disabled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
module.exports = ({ context }) => { | ||
const defaultPythonVersion = "3.8"; | ||
const supportedPythonVersions = ["3.6", "3.7", "3.8", "3.9"]; | ||
const supportedAdapters = ["apache_spark", "databricks_http", "databricks_cluster", "databricks_endpoint"]; | ||
|
||
// if PR, generate matrix based on files changed and PR labels | ||
if (context.eventName.includes("pull_request")) { | ||
// `changes` is a list of adapter names that have related | ||
// file changes in the PR | ||
// ex: ['postgres', 'snowflake'] | ||
const changes = JSON.parse(process.env.CHANGES); | ||
const labels = context.payload.pull_request.labels.map(({ name }) => name); | ||
console.log("labels", labels); | ||
console.log("changes", changes); | ||
const testAllLabel = labels.includes("test all"); | ||
const include = []; | ||
|
||
for (const adapter of supportedAdapters) { | ||
if ( | ||
changes.includes(adapter) || | ||
testAllLabel || | ||
labels.includes(`test ${adapter}`) | ||
) { | ||
for (const pythonVersion of supportedPythonVersions) { | ||
if ( | ||
pythonVersion === defaultPythonVersion || | ||
labels.includes(`test python${pythonVersion}`) || | ||
testAllLabel | ||
) { | ||
// always run tests on ubuntu by default | ||
include.push({ | ||
os: "ubuntu-latest", | ||
adapter, | ||
"python-version": pythonVersion, | ||
}); | ||
|
||
if (labels.includes("test windows") || testAllLabel) { | ||
include.push({ | ||
os: "windows-latest", | ||
adapter, | ||
"python-version": pythonVersion, | ||
}); | ||
} | ||
|
||
if (labels.includes("test macos") || testAllLabel) { | ||
include.push({ | ||
os: "macos-latest", | ||
adapter, | ||
"python-version": pythonVersion, | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
console.log("matrix", { include }); | ||
|
||
return { | ||
include, | ||
}; | ||
} | ||
// if not PR, generate matrix of python version, adapter, and operating | ||
// system to run integration tests on | ||
|
||
const include = []; | ||
// run for all adapters and python versions on ubuntu | ||
for (const adapter of supportedAdapters) { | ||
for (const pythonVersion of supportedPythonVersions) { | ||
include.push({ | ||
os: 'ubuntu-latest', | ||
adapter: adapter, | ||
"python-version": pythonVersion, | ||
}); | ||
} | ||
} | ||
|
||
// additionally include runs for all adapters, on macos and windows, | ||
// but only for the default python version | ||
for (const adapter of supportedAdapters) { | ||
for (const operatingSystem of ["windows-latest", "macos-latest"]) { | ||
include.push({ | ||
os: operatingSystem, | ||
adapter: adapter, | ||
"python-version": defaultPythonVersion, | ||
}); | ||
} | ||
} | ||
|
||
console.log("matrix", { include }); | ||
|
||
return { | ||
include, | ||
}; | ||
}; |
Oops, something went wrong.