From 3af8277febb74dddac8da5370dc264ed67954629 Mon Sep 17 00:00:00 2001 From: Denys Otrishko Date: Thu, 30 Jul 2020 11:00:01 +0300 Subject: [PATCH] Implement separate labs and linting workflow --- .github/workflows/labs.yml | 21 +++++++++++++++++++++ .github/workflows/test.yml | 10 +++++++--- package.json | 5 +++-- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/labs.yml diff --git a/.github/workflows/labs.yml b/.github/workflows/labs.yml new file mode 100644 index 0000000..c845baf --- /dev/null +++ b/.github/workflows/labs.yml @@ -0,0 +1,21 @@ +name: Check labs + +on: pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Node.js + uses: actions/setup-node@v1 + with: + node-version: 14 + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm ci + - run: npm run hpw diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c56ccb1..6019ed7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ -name: Check labs +name: Lint -on: pull_request +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: build: @@ -18,4 +22,4 @@ jobs: restore-keys: | ${{ runner.os }}-node- - run: npm ci - - run: npm t + - run: npm run lint diff --git a/package.json b/package.json index 775a83f..06a2e3b 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "author": "Timur Shemsedinov ", "license": "MIT", "scripts": { - "test": "eslint ./Exercises; hpw", - "ci": "eslint ./Exercises && hpw" + "test": "npm run -s lint; npm run -s hpw", + "lint": "eslint ./Exercises", + "hpw": "hpw" }, "dependencies": { "eslint": "^7.5.0",