Skip to content

Commit

Permalink
Testing setup (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka authored Jun 2, 2020
1 parent 5d81c89 commit 9685642
Show file tree
Hide file tree
Showing 9 changed files with 803 additions and 421 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ out/

# VS Code
*.code-workspace
.vscode-test/

# Build
.gradle/
Expand Down
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ cache:
env:
- NODE_VERSION=10.16

before_install:
- sudo apt-get -y install libsecret-1-dev

install:
- nvm install $NODE_VERSION
- npm install
- |
export DISPLAY=':99.0'
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
script:
- nvm use $NODE_VERSION
- |
if [[ $TRAVIS_TAG =~ ^v.* ]]; then
./gradlew clean final npmInstall -Prelease.useLastTag=true
./gradlew clean final vscodeExtension -Prelease.useLastTag=true
else
./gradlew clean snapshot npmInstall
./gradlew clean snapshot vscodeExtension
fi
4 changes: 1 addition & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ npmInstall {
outputs.dir('out')
}

task vscodeExtension(dependsOn: [npmInstall, npmInstallVsce], type: NodeTask) {
task test(dependsOn: [npmInstall], type: NpmTask) {
args = ['run', 'test']

inputs.files fileTree('src')
inputs.file 'package.json'
inputs.file 'package-lock.json'
}

task vscodeExtension(dependsOn: [npmInstall, npmInstallVsce, test], type: NodeTask) {
ext.destDir = new File(buildDir, 'vscode')
ext.archiveName = "${project.name}-${project.version.toString()}.vsix"
ext.destPath = "${ext.destDir}/${ext.archiveName}"
Expand Down
Loading

0 comments on commit 9685642

Please sign in to comment.