From fde9ae9bae4588903ffd5b00ac7fe54c8ad9c98b Mon Sep 17 00:00:00 2001 From: ThunderMiracle Date: Fri, 3 Jun 2022 08:44:10 +0900 Subject: [PATCH] chore: use github action instead of circleci (#27) * chore: use github action instead of circleci * chore: fix install command in ci * chore: use Codecov github action --- .circleci/config.yml | 60 --------------------------------------- .github/workflows/ci.yaml | 49 ++++++++++++++++++++++++++++++++ package.json | 9 +++--- tsconfig.json | 2 +- 4 files changed, 54 insertions(+), 66 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index bff91f2..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,60 +0,0 @@ -executors: - node: - docker: - - image: circleci/node:10 - -aliases: - restore_cache: &restore_cache - restore_cache: - name: Restore Npm Package Cache - keys: - - yarn-cache-test-0.1.0-{{ checksum "yarn.lock" }} - - install_node_modules: &install_node_modules - run: - name: Install dependencies - command: yarn - - save_cache: &save_cache - save_cache: - name: Save NPM package cache - key: yarn-cache-test-0.1.0-{{ checksum "yarn.lock" }} - paths: - - ./node_modules - -version: 2.1 - -jobs: - test: - executor: node - steps: - - checkout - - <<: *restore_cache - - <<: *install_node_modules - - <<: *save_cache - - run: - name: Test - command: yarn test - - build: - executor: node - steps: - - checkout - - <<: *restore_cache - - <<: *install_node_modules - - run: - name: Build - command: yarn build - -workflows: - version: 2 - build_and_deploy: - jobs: - - test: - filters: - branches: - ignore: - - gh-pages - - build: - requires: - - test diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..2234661 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,49 @@ +name: 'CI' + +on: + push: + branches: + - main + pull_request: + types: ['opened', 'edited', 'synchronize'] + +jobs: + test: + name: 'Test in: ${{ matrix.os }}, node-${{ matrix.node }}' + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [12, 14, 16] + + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: set up node.js v${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: "yarn" + + - name: cache node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} + + - name: install dependencies + run: yarn install + + - name: test + run: yarn test + + - name: build + run: yarn build + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/package.json b/package.json index 57568f6..e940971 100644 --- a/package.json +++ b/package.json @@ -27,13 +27,13 @@ }, "homepage": "https://github.com/thundermiracle/filter-data#readme", "scripts": { - "eslint:src": "eslint src/**/*.{ts,tsx}", - "eslint:test": "eslint __test__/**/*.{ts,tsx}", + "eslint:src": "eslint src/**/*.ts", + "eslint:test": "eslint __test__/**/*.ts", "eslint": "yarn eslint:src && yarn eslint:test", "jest": "jest", "type-check": "tsc --noEmit --project tsconfig.eslint.json", "type-check:watch": "yarn type-check -- --watch", - "test": "yarn type-check && yarn eslint && yarn jest && codecov", + "test": "yarn type-check && yarn eslint && yarn jest", "bench": "ts-node ./benchmark/index.ts", "build:js:cjs": "tsc", "build:js:es": "tsc --project tsconfig.es.json", @@ -55,7 +55,6 @@ "@types/ramda": "^0.26.44", "@typescript-eslint/eslint-plugin": "^2.23.0", "@typescript-eslint/parser": "^2.23.0", - "codecov": "^3.6.5", "eslint": "^6.8.0", "eslint-config-airbnb-base": "^14.1.0", "eslint-config-prettier": "^6.10.0", @@ -77,4 +76,4 @@ "ts-node": "^8.6.2", "typescript": "^3.8.3" } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 50a3a70..e784216 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "./lib/", - "sourceMap": false, + "sourceMap": true, "target": "es5", "module": "CommonJS", "declaration": true,