Skip to content
Permalink
Browse files

feat(initializer): add Travis/AppVeyor CI files to default template

ISSUES CLOSED: #30
  • Loading branch information
malept committed Aug 20, 2017
1 parent 6275d2b commit 296bdde82f5b9b9e26a0626ee5be582d89ee60d3
Showing with 65 additions and 3 deletions.
  1. +1 −1 src/init/init-starter-files.js
  2. +3 −1 test/slow/api_spec_slow.js
  3. +26 −0 tmpl/_appveyor.yml
  4. +33 −0 tmpl/_travis.yml
  5. +2 −1 tmpl/package.json
@@ -17,7 +17,7 @@ export default async (dir, lintStyle) => {

d('creating directory:', path.resolve(dir, 'src'));
await fs.mkdirs(path.resolve(dir, 'src'));
const rootFiles = ['_gitignore', '_compilerc'];
const rootFiles = ['_gitignore', '_compilerc', '_travis.yml', '_appveyor.yml'];
if (lintStyle === 'airbnb') rootFiles.push('_eslintrc');
const srcFiles = ['index.js', 'index.html'];

@@ -34,7 +34,9 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {

it('should create a new folder with a npm module inside', async () => {
expect(await fs.pathExists(dir), 'the target dir should have been created').to.equal(true);
expect(await fs.pathExists(path.resolve(dir, 'package.json')), 'the package.json file should exist').to.equal(true);
for (const filename of ['package.json', '.travis.yml', '.appveyor.yml']) {
expect(await fs.pathExists(path.resolve(dir, filename)), `the ${filename} file should exist`).to.equal(true);
}
});

it('should have initialized a git repository', async () => {
@@ -0,0 +1,26 @@
platform:
- x64
environment:
nodejs_version: "6"
cache:
- '%APPDATA%\npm-cache'
- '%USERPROFILE%\.electron'
- node_modules
branches:
only:
- master
- /^v\d+\.\d+\.\d+/
install:
- ps: Install-Product node $env:nodejs_version $env:platform
- set PATH=%APPDATA%\npm;%PATH%
- npm install
- npm update

test_script:
- node --version
- npm --version
- npm run lint
- if %APPVEYOR_REPO_TAG% EQU false npm run make

build_script:
- IF %APPVEYOR_REPO_TAG% EQU true npm run publish
@@ -0,0 +1,33 @@
language: node_js
node_js: "6"
os:
- linux
- osx
dist: trusty
osx_image: xcode8.3
sudo: false

cache:
directories:
- node_modules
- $HOME/.cache/electron

addons:
apt:
packages:
- fakeroot
- rpm

branches:
only:
- master
- /^v\d+\.\d+\.\d+/

install:
- npm install
- npm update

script:
- npm run lint
- if test -z "$TRAVIS_TAG"; then npm run make; fi
after_success: if test -n "$TRAVIS_TAG"; then npm run publish; fi
@@ -7,7 +7,8 @@
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make"
"make": "electron-forge make",
"publish": "electron-forge publish"
},
"keywords": [],
"author": "",

0 comments on commit 296bdde

Please sign in to comment.
You can’t perform that action at this time.