From 602c09a1775cf55b062e39b72a62f3fe87632409 Mon Sep 17 00:00:00 2001 From: Adam Marcinkowski Date: Mon, 29 Mar 2021 11:35:45 +0200 Subject: [PATCH] feat: add github actions #91 --- .circleci/config.yml | 38 ------------------------------------- .github/workflows/test.yaml | 24 +++++++++++++++++++++++ package.json | 1 + test/module.test.js | 1 - 4 files changed, 25 insertions(+), 39 deletions(-) delete mode 100755 .circleci/config.yml create mode 100644 .github/workflows/test.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100755 index 78c4e41c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/node - steps: - # Checkout repository - - checkout - - # Restore cache - - restore_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - - # Install dependencies - - run: - name: Install Dependencies - command: NODE_ENV=dev yarn - - # Keep cache - - save_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - paths: - - "node_modules" - - # Lint - - run: - name: Lint - command: yarn lint - - # Tests - - run: - name: Tests - command: yarn jest - - # Coverage - - run: - name: Coverage - command: yarn codecov diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..909d628c --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,24 @@ +name: Lint + +on: [push, pull_request] + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 12 + - run: yarn --frozen-lockfile + + - name: Commitlint + run: yarn commitlint + + - name: Eslint + run: yarn lint diff --git a/package.json b/package.json index c3e746a7..95461583 100755 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "lint": "eslint --ignore-pattern '/lib/templates/plugins' --ext .js,.vue example lib test", "lintfix": "eslint --fix --ext .js,.vue --ignore-pattern '/lib/templates/plugins' --ignore-path .gitignore .", "test": "yarn lint && jest", + "commitlint": "commitlint --from HEAD~1", "release": "yarn test && standard-version && git push --follow-tags && npm publish" }, "files": [ diff --git a/test/module.test.js b/test/module.test.js index 6ecd6ceb..7f053ef4 100644 --- a/test/module.test.js +++ b/test/module.test.js @@ -13,7 +13,6 @@ describe('module', () => { test('render', async () => { const html = await get('/') - console.log(html) expect(html).toContain('page') }) })