mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 04:51:08 -05:00
Add Drone CI pipeline
This commit is contained in:
parent
d713ee66a8
commit
f9b6b4c247
41
.drone.jsonnet
Normal file
41
.drone.jsonnet
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Pipeline template
|
||||||
|
local test_with(version, use_network=false) = {
|
||||||
|
kind: "pipeline",
|
||||||
|
type: "docker",
|
||||||
|
name: "py" + version + (if use_network then '-online' else ''),
|
||||||
|
steps: [
|
||||||
|
{
|
||||||
|
name: "test",
|
||||||
|
image: "python:" + version + "-buster",
|
||||||
|
commands: [
|
||||||
|
"pip install -r requirements.txt",
|
||||||
|
"apt-get update",
|
||||||
|
# For SysDNS
|
||||||
|
"apt-get -yy install bind9-host",
|
||||||
|
"./tests-wrapper.sh" + if !use_network then ' --no-network' else ''
|
||||||
|
],
|
||||||
|
failure: if use_network then "ignore",
|
||||||
|
environment: {
|
||||||
|
[secret_name]: {
|
||||||
|
from_secret: secret_name
|
||||||
|
}
|
||||||
|
for secret_name in [
|
||||||
|
"AQICN_APIKEY",
|
||||||
|
"NUWEATHER_APIKEY_DARKSKY",
|
||||||
|
"NUWEATHER_APIKEY_OPENWEATHERMAP",
|
||||||
|
"NUWEATHER_APIKEY_WEATHERSTACK",
|
||||||
|
"lastfm_apikey",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
test_with("3.6"),
|
||||||
|
test_with("3.6", use_network=true),
|
||||||
|
test_with("3.7"),
|
||||||
|
test_with("3.8"),
|
||||||
|
test_with("3.9"),
|
||||||
|
test_with("3.9", use_network=true),
|
||||||
|
]
|
11
tests-wrapper.sh
Executable file
11
tests-wrapper.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exclude stubs for (re)moved plugins
|
||||||
|
SKIP_PLUGINS=("--exclude=./Weather" "--exclude=./DDG" "--exclude=./SedRegex")
|
||||||
|
|
||||||
|
if [[ -n "$DRONE_PULL_REQUEST" ]]; then
|
||||||
|
echo "Skipping tests that require secret API keys"
|
||||||
|
export SKIP_PLUGINS+=("--exclude=./LastFM" "--exclude=./NuWeather" "--exclude=./AQI")
|
||||||
|
fi
|
||||||
|
|
||||||
|
supybot-test -c --plugins-dir=. "${SKIP_PLUGINS[@]}" "$@"
|
Loading…
x
Reference in New Issue
Block a user