Merge pull request #19096 from atom/lint-early-and-fail-fast

Update CI scripts to lint early and fail fast
This commit is contained in:
Jason Rudolph 2019-04-03 20:49:17 -04:00 committed by GitHub
commit b50818e773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 21 deletions

View File

@ -28,11 +28,12 @@ install:
- nvm install $NODE_VERSION - nvm install $NODE_VERSION
- nvm use --delete-prefix $NODE_VERSION - nvm use --delete-prefix $NODE_VERSION
- npm install --global npm@6.2.0 - npm install --global npm@6.2.0
- script/build --create-debian-package --create-rpm-package --compress-artifacts - script/bootstrap
script: script: >
- script/lint script/lint &&
- script/test script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts &&
script/test
cache: cache:
directories: directories:

View File

@ -2,9 +2,13 @@
'use strict' 'use strict'
// Run bootstrap first to ensure all the dependencies used later in this script if (process.argv.includes('--no-bootstrap')) {
// are installed. console.log('Skipping bootstrap')
require('./bootstrap') } else {
// Bootstrap first to ensure all the dependencies used later in this script
// are installed.
require('./bootstrap')
}
// Needed so we can require src/module-cache.coffee during generateModuleCache // Needed so we can require src/module-cache.coffee during generateModuleCache
require('coffee-script/register') require('coffee-script/register')

View File

@ -12,15 +12,18 @@ jobs:
container: atom-linux-ci container: atom-linux-ci
steps: steps:
- script: script/build --create-debian-package --create-rpm-package --compress-artifacts - script: script/bootstrap
displayName: Bootstrap build environment
- script: script/lint
displayName: Run linter
- script: script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts
env: env:
GITHUB_TOKEN: $(GITHUB_TOKEN) GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion) ATOM_RELEASE_VERSION: $(ReleaseVersion)
displayName: Build Atom displayName: Build Atom
- script: script/lint
displayName: Run linter
- script: script/test - script: script/test
env: env:
CI: true CI: true

View File

@ -19,11 +19,17 @@ jobs:
- script: npm install --global npm@6.2.0 - script: npm install --global npm@6.2.0
displayName: Update npm displayName: Update npm
- script: script/bootstrap
displayName: Bootstrap build environment
- script: script/lint
displayName: Run linter
- script: | - script: |
if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then
script/build --code-sign --compress-artifacts script/build --no-bootstrap --code-sign --compress-artifacts
else else
script/build --compress-artifacts script/build --no-bootstrap --compress-artifacts
fi fi
displayName: Build Atom displayName: Build Atom
env: env:
@ -36,9 +42,6 @@ jobs:
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN) ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD) ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
- script: script/lint
displayName: Run linter
- script: | - script: |
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
caffeinate -s script/test # Run with caffeinate to prevent screen saver caffeinate -s script/test # Run with caffeinate to prevent screen saver

View File

@ -36,6 +36,17 @@ jobs:
npm install npm install
displayName: Install Windows build dependencies displayName: Install Windows build dependencies
- script: |
node script\vsts\windows-run.js script\bootstrap.cmd
env:
BUILD_ARCH: $(buildArch)
displayName: Bootstrap build environment
- script: node script\vsts\windows-run.js script\lint.cmd
env:
BUILD_ARCH: $(buildArch)
displayName: Run linter
- script: | - script: |
IF NOT EXIST C:\tmp MKDIR C:\tmp IF NOT EXIST C:\tmp MKDIR C:\tmp
SET SQUIRREL_TEMP=C:\tmp SET SQUIRREL_TEMP=C:\tmp
@ -61,11 +72,6 @@ jobs:
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch) IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
displayName: Build Atom displayName: Build Atom
- script: node script\vsts\windows-run.js script\lint.cmd
env:
BUILD_ARCH: $(buildArch)
displayName: Run linter
- script: node script\vsts\windows-run.js script\test.cmd - script: node script\vsts\windows-run.js script\test.cmd
env: env:
CI: true CI: true