Skip to content

Commit

Permalink
ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace Ci Bot authored and nightwing committed Mar 31, 2024
1 parent 076d177 commit c0c85b3
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 2 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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: CI

on:
pull_request:
branches: [ master ]

permissions:
contents: write # to fetch code (actions/checkout)

jobs:
update-docs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}

- 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
# run linter
- run: |
set -x;
git status;
git checkout HEAD -- package.json;
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 --fix "lib/ace/**/*.js";
else
jsChanges=$(echo "$changes" | grep -P '.js$' || :);
if [ "$jsChanges" == "" ]; then
echo "nothing to check";
else
echo "checking $jsChanges";
node node_modules/eslint/bin/eslint --fix $jsChanges;
fi
fi
# check types
- run: npm run update-types
- run: node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts
- run: npm run typecheck
# push automatic fixes to the pull request
- run: |
set -x;
git status;
git add -u
git reset -- build
git config user.name "Ace Ci Bot"
git config user.email "bot@c9.io"
git commit -m "ci fixes" --author="Ace Ci Bot <bot@c9.io>"
git branch -f CI_FIXES
git remote -v
git log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- | head -n 100
- run: git push
4 changes: 3 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run cover
# run linter
- run: |
set -x;
git status;
Expand All @@ -50,7 +51,8 @@ jobs:
node node_modules/eslint/bin/eslint $jsChanges;
fi
fi
# - run: npm run lint
# check types
- run: npm run update-types
- run: node_modules/.bin/tsc --noImplicitAny --strict --noUnusedLocals --noImplicitReturns --noUnusedParameters --noImplicitThis ace.d.ts
- run: npm run typecheck
- uses: codecov/codecov-action@v3
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"lint": "eslint \"src/**/*.js\"",
"fix": "eslint --fix \"src/**/*.js\"",
"typecheck": "tsc -p tsconfig.json",
"update-types": "node ./tool/modes-declaration-generator.js",
"changelog": "standard-version",
"prepack": "node tool/esm_resolver_generator.js && node Makefile.dryice.js css --target build-styles && rm -rf styles && mv build-styles/css styles"
},
Expand Down
2 changes: 1 addition & 1 deletion src/keyboard/hash_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ MultiHashHandler.call = function(thisArg, config, platform) {
};

exports.HashHandler = HashHandler;
exports.MultiHashHandler = MultiHashHandler;
exports.MultiHashHandler = MultiHashHandler

Check failure on line 300 in src/keyboard/hash_handler.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

0 comments on commit c0c85b3

Please sign in to comment.