From eed87a8adb432da6d5b09bc768813ca78bb4bc61 Mon Sep 17 00:00:00 2001 From: Yannick Schaus Date: Sun, 7 Mar 2021 02:19:24 +0100 Subject: [PATCH] Add ESLint action for Main UI Signed-off-by: Yannick Schaus --- .github/workflows/mainui-eslint.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/mainui-eslint.yml diff --git a/.github/workflows/mainui-eslint.yml b/.github/workflows/mainui-eslint.yml new file mode 100644 index 000000000..cb7d2521e --- /dev/null +++ b/.github/workflows/mainui-eslint.yml @@ -0,0 +1,48 @@ +# This is a basic workflow to help you get started with Actions + +name: Main UI ESLint + +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + paths: bundles/org.openhab.ui/web + pull_request: + branches: [ main ] + paths: bundles/org.openhab.ui/web + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +defaults: + run: + working-directory: bundles/org.openhab.ui/web + +jobs: + build: + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '12.x' + + - name: Cache node modules + id: cache + uses: actions/cache@v1 + with: + path: node_modules # npm cache files are stored in `~/.npm` on Linux/macOS + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + run: npm install + + - name: Run ESLint + run: npx eslint src/**/*.js src/**/*.vue