Skip to content

Commit

Permalink
Use nodejs docker image for JS steps in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Aug 27, 2021
1 parent 3347351 commit 6080dc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
27 changes: 11 additions & 16 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def dependencies(ctx):

default = {
"phpVersions": ["7.2"],
"nodeJsVersion": "14",
}

if "defaults" in config:
Expand Down Expand Up @@ -446,7 +447,7 @@ def dependencies(ctx):
vendorbinPhan(phpVersion) +
vendorbinPhpstan(phpVersion) +
vendorbinBehat() +
yarnInstall(phpVersion) +
yarnInstall(params["nodeJsVersion"]) +
cacheRebuildOnEventPush() +
cacheFlushOnEventPush(),
"depends_on": [],
Expand Down Expand Up @@ -513,7 +514,6 @@ def codestyle():
composerInstall(phpVersion) +
vendorbinCodestyle(phpVersion) +
vendorbinCodesniffer(phpVersion) +
yarnInstall(phpVersion) +
[
{
"name": "php-style",
Expand Down Expand Up @@ -737,7 +737,6 @@ def phpstan():
"steps": cacheRestore() +
composerInstall(phpVersion) +
vendorbinPhpstan(phpVersion) +
yarnInstall(phpVersion) +
installServer(phpVersion, "sqlite", params["logLevel"]) +
[
{
Expand Down Expand Up @@ -810,7 +809,6 @@ def phan():
"steps": cacheRestore() +
composerInstall(phpVersion) +
vendorbinPhan(phpVersion) +
yarnInstall(phpVersion) +
installServer(phpVersion, "sqlite", params["logLevel"]) +
[
{
Expand Down Expand Up @@ -891,7 +889,6 @@ def litmus():
},
"steps": cacheRestore() +
composerInstall(phpVersion) +
yarnInstall(phpVersion) +
installServer(phpVersion, db, params["logLevel"], params["useHttps"]) +
setupLocalStorage(phpVersion) +
fixPermissions(phpVersion, False) +
Expand Down Expand Up @@ -1056,7 +1053,6 @@ def dav():
},
"steps": cacheRestore() +
composerInstall(phpVersion) +
yarnInstall(phpVersion) +
installServer(phpVersion, db, params["logLevel"]) +
davInstall(phpVersion, scriptPath) +
fixPermissions(phpVersion, False) +
Expand Down Expand Up @@ -1092,9 +1088,9 @@ def javascript(ctx, withCoverage):
return pipelines

default = {
"nodeJsVersion": "14",
"coverage": True,
"logLevel": "2",
"phpVersion": "7.2",
"skip": False,
}

Expand Down Expand Up @@ -1136,12 +1132,11 @@ def javascript(ctx, withCoverage):
"path": "src",
},
"steps": cacheRestore() +
composerInstall(params["phpVersion"]) +
yarnInstall(params["phpVersion"]) +
yarnInstall(params["nodeJsVersion"]) +
[
{
"name": "test-js",
"image": "owncloudci/php:%s" % params["phpVersion"],
"image": "owncloudci/php:7.4",
"pull": "always",
"commands": [
"make test-js",
Expand Down Expand Up @@ -1326,7 +1321,6 @@ def phpTests(ctx, testType, withCoverage):
},
"steps": cacheRestore() +
composerInstall(phpVersion) +
yarnInstall(phpVersion) +
installServer(phpVersion, db, params["logLevel"]) +
installExtraApps(phpVersion, extraAppsDict, dir["server"]) +
setupScality(phpVersion, needScality) +
Expand Down Expand Up @@ -1446,6 +1440,7 @@ def acceptance(ctx):
"federatedServerVersions": [""],
"browsers": ["chrome"],
"phpVersions": ["7.4"],
"nodeJsVersion": "14",
"databases": ["mariadb:10.2"],
"federatedPhpVersion": "7.2",
"federatedServerNeeded": False,
Expand Down Expand Up @@ -1643,7 +1638,7 @@ def acceptance(ctx):
"steps": cacheRestore() +
composerInstall(phpVersion) +
vendorbinBehat() +
yarnInstall(phpVersion) +
yarnInstall(params["nodeJsVersion"]) +
((
installCoreFromTarball(params["coreTarball"], db, params["logLevel"], params["useHttps"], params["federatedServerNeeded"], params["proxyNeeded"], pathOfServerUnderTest)
) if params["testAgainstCoreTarball"] else (
Expand Down Expand Up @@ -1702,7 +1697,7 @@ def acceptance(ctx):

return pipelines

def sonarAnalysis(ctx, phpVersion = "7.4"):
def sonarAnalysis(ctx, phpVersion = "7.4", nodeJsVersion = "14"):
sonar_env = {
"SONAR_TOKEN": {
"from_secret": "sonar_token",
Expand Down Expand Up @@ -1742,7 +1737,7 @@ def sonarAnalysis(ctx, phpVersion = "7.4"):
] +
cacheRestore() +
composerInstall(phpVersion) +
yarnInstall(phpVersion) +
yarnInstall(nodeJsVersion) +
installServer(phpVersion, "sqlite") +
[
{
Expand Down Expand Up @@ -2382,10 +2377,10 @@ def vendorbinBehat():
],
}]

def yarnInstall(phpVersion):
def yarnInstall(nodeJsVersion):
return [{
"name": "yarn-install",
"image": "owncloudci/php:%s" % phpVersion,
"image": "owncloudci/nodejs:%s" % nodeJsVersion,
"pull": "always",
"environment": {
"NPM_CONFIG_CACHE": "%s/.cache/npm" % dir["server"],
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ KARMA=$(NODE_PREFIX)/node_modules/.bin/karma
JSDOC=$(NODE_PREFIX)/node_modules/.bin/jsdoc
PHPUNIT="$(shell pwd)/lib/composer/phpunit/phpunit/phpunit"
COMPOSER_BIN := $(shell command -v composer 2> /dev/null)
ifndef COMPOSER_BIN
$(error composer is not available on your system, please install composer)
endif

# bin file definitions
PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer
Expand Down Expand Up @@ -269,7 +266,7 @@ clean-docs:
rm -Rf build/jsdocs

.PHONY: test-doc-links
test-doc-links:
test-doc-links:
php tests/docs/DocLinksTest.php $(DOC_LINK_VERSION)

#
Expand Down

0 comments on commit 6080dc5

Please sign in to comment.