Skip to content

Commit

Permalink
feat: add gitlab ci (#310)
Browse files Browse the repository at this point in the history
* feat: add gitlab ci

* fix: add lock

* chore: add manual to pre-release

* fix: add path to aegir.js

* fix: fix node 10 run

* chore: lock

* chore: lock 2

* chore: test go-ipfs

* chore: test yarn

* chore: test bug node 10

* chore: test bug node 10 2

* chore: test bug node 10

* chore: add node 11

* chore: add node 11 2

* chore: add node 11 2

* chore: add mac

* chore: add win

* chore: fix deps

* chore: fix deps 2

* fix: tweak config
  • Loading branch information
hugomrdias committed Nov 28, 2018
1 parent 4084194 commit 7df2805
Show file tree
Hide file tree
Showing 6 changed files with 25,427 additions and 4 deletions.
35 changes: 34 additions & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'

const path = require('path')
const createServer = require('./src').createServer

const server = createServer() // using defaults
Expand All @@ -11,6 +11,39 @@ module.exports = {
served: true,
included: false
}],
reporters: ['coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['json'],
dir: path.join(__dirname, 'coverage'),
combineBrowserReports: true,
fixWebpackSourcePaths: true,
},
preprocessors: { 'node_modules/aegir/src/config/karma-entry.js': [ 'webpack', 'sourcemap' ] },
webpack: {
module: {
rules: [
// instrument only testing sources with Istanbul
{
test: /\.js$/,
use: { loader: 'istanbul-instrumenter-loader' },
include: path.resolve('src/')
}
]
}
},
customLaunchers: {
ChromeDocker: {
base: 'ChromeHeadless',
// We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
// more permissions than Docker allows by default)
flags: ['--no-sandbox']
}
},
client: {
mocha: {
bail: true,
}
},
singleRun: true
},
hooks: {
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package-lock.json
yarn.lock

**/node_modules/
Expand Down
98 changes: 98 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
image: hugomrdias/node-alpine:test
stages:
- check
- test
- cov
- pre-release
- release

variables:
DOCKER_DRIVER: overlay2

before_script:
- npm ci -q

check:
stage: check
script:
- npm run lint
- npm run dep-check
# - npm install --no-lockfile @commitlint/config-conventional @commitlint/cli --save-dev
# - npx commitlint --extends=@commitlint/config-conventional --from=$CI_COMMIT_BEFORE_SHA --to=$CI_COMMIT_SHA
- npm run build
artifacts:
paths:
- dist/

linux-node-10:
image: node:10
stage: test
script:
- npx nyc -s npm run test:node -- --bail
artifacts:
paths:
- .nyc_output/

linux-node-11:
allow_failure: true
image: node:11
stage: test
script:
- ls ./node_modules/go-ipfs-dep/go-ipfs
- npx nyc -s npm run test:node -- --bail
artifacts:
paths:
- .nyc_output/

macos-node-10:
stage: test
script:
- npx nyc -s npm run test:node -- --bail
tags:
- mac
artifacts:
paths:
- .nyc_output/

win-node-10:
stage: test
script:
- npx nyc -s npm run test:node -- --bail
tags:
- win
artifacts:
paths:
- .nyc_output/

test-browser-chrome:
image: hugomrdias/node-chrome:test
stage: test
script:
- AEGIR_BROWSERS=ChromeDocker npm run test:browser

test-browser-firefox:
image: hugomrdias/node-firefox:test
stage: test
script:
- AEGIR_BROWSERS=FirefoxHeadless npm run test:browser
artifacts:
paths:
- coverage/

cov:
stage: cov
before_script: []
variables:
GIT_STRATEGY: none
script:
- cp coverage/coverage-final.json .nyc_output/browser.json
- npx nyc report --reporter text-summary --reporter html
dependencies:
- linux-node-10
- win-node-10
- macos-node-10
- test-browser-firefox
artifacts:
paths:
- coverage/
coverage: '/Lines : \d+\.\d+/'
Loading

0 comments on commit 7df2805

Please sign in to comment.