Add Appveyor test, update readme
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded

This commit is contained in:
TheThing 2022-01-10 08:56:55 +00:00 committed by Jonatan Nilsson
parent f9db881123
commit c476ef7b18
4 changed files with 40 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# storage-upload
# storage-upload [![Build status](https://ci.nfp.is/api/projects/status/29k8rnhf5w8s0hn4/branch/master?svg=true)](https://ci.nfp.is/project/AppVeyor/storage-upload/branch/master)
Micro service for uploading and image resizing files to a storage server.

View file

@ -12,14 +12,21 @@ skip_tags: true
# Maximum number of concurrent jobs for the project
max_jobs: 1
clone_depth: 1
# Build worker image (VM template)
build_cloud: Docker
image: node
environment:
docker_image: node:16-alpine
npm_config_cache: /appveyor/projects/cache
build_script:
- sh: npm install
- sh: npm list --all
- sh: |
chown -R node:node /appveyor/projects
npm install
npm list --all
test_script:
- sh: npm test
- sh: |
npm run test:linux

View file

@ -24,7 +24,7 @@
"flaska": "^0.9.8",
"formidable": "^1.2.2",
"nconf-lite": "^2.0.0",
"sharp-lite": "^1.29.5"
"sharp-lite": "^1.29.6"
},
"devDependencies": {
"eltro": "^1.2.3"

27
test.js Normal file
View file

@ -0,0 +1,27 @@
const fs = require('fs');
const os = require('os');
const path = require('path');
const env = process.env;
const mkdirSync = function (dirPath) {
try {
fs.mkdirSync(dirPath, { recursive: true });
} catch (err) {
/* istanbul ignore next */
if (err.code !== 'EEXIST') {
throw err;
}
}
};
const cachePath = function () {
const npmCachePath = env.npm_config_cache || /* istanbul ignore next */
(env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(os.homedir(), '.npm'));
mkdirSync(npmCachePath);
const libvipsCachePath = path.join(npmCachePath, '_libvips');
mkdirSync(libvipsCachePath);
return libvipsCachePath;
};
cachePath()