diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 00000000000..43c050d731a --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,46 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8.x] + + steps: + - uses: actions/checkout@v2 + - name: Fetch the master branch + run: git fetch origin HEAD:refs/remotes/origin/HEAD --depth 1 + - name: Fetch the master branch + run: git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm i && npm i eslint codecov istanbul typescript + - run: node_modules/.bin/istanbul cover lib/ace/test/all.js + - run: changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR); + # if [ "$changes" == "" ]; then + # echo "checking all files"; + # node node_modules/eslint/bin/eslint "lib/ace/**/*.js"; + # else + # changes=$(echo "$changes" | grep -P '.js$'); + # echo "checking $changes"; + # if [ "$changes" != "" ]; then + # node node_modules/eslint/bin/eslint $changes; + # fi + # fi + - run: npm run lint + - run: node_modules/.bin/codecov + - run: node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3936326cbc7..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: node_js - -node_js: - - "8" - -install: - - cleanup() { find node_modules -regextype posix-extended -iregex '.*((test|example|doc|demo)s?|\.(md)|license|idea|coverage|file.txt)$' -exec rm -rf {} \; || echo $?; }; - install() { npm i && npm i eslint codecov istanbul typescript && cp package.json node_modules/package.json; cleanup; }; - cmp --silent package.json node_modules/package.json || install; - -script: - - changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR); - if [ "$changes" == "" ]; then - echo "checking all files"; - node node_modules/eslint/bin/eslint "lib/ace/**/*.js"; - else - changes=$(echo "$changes" | grep -P '.js$'); - echo "checking $changes"; - if [ "$changes" != "" ]; then - node node_modules/eslint/bin/eslint $changes; - fi - fi - - node_modules/.bin/istanbul cover lib/ace/test/all.js - - node_modules/.bin/codecov - - node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts - -matrix: - fast_finish: false - -cache: - directories: - - node_modules - -sudo: false - -git: - depth: 1 - submodules: false - -branches: - only: - - master \ No newline at end of file