diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 580be6f5..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,45 +0,0 @@ -version: 2.1 - -jobs: - build: - docker: - - image: node:18 - - steps: - - checkout - - restore_cache: - name: Restore pnpm Package Cache - keys: - - pnpm-packages-{{ checksum "pnpm-lock.yaml" }} - - run: - name: Install pnpm package manager - command: | - curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm@7 - - run: - name: Install Dependencies - command: | - pnpm install - - save_cache: - name: Save pnpm Package Cache - key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }} - paths: - - node_module - - - - run: # RUN LINTER - name: ESLint - command: pnpm run lint --format junit -o reports/junit/js-lint-results.xml - - run: # RUN TESTS - name: Tests - command: pnpm run test --ci --runInBand --reporters=default --reporters=jest-junit --coverage - environment: - JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" - - - store_test_results: - path: reports/junit - - store_artifacts: - path: reports/junit - - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ - path: coverage - prefix: coverage - \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d49b002b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + ci: + runs-on: ubuntu-latest + + # strategy: + # matrix: + # node-version: [20.x] # [14.x, 16.x, 18.x] + # # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm run lint --format junit -o reports/junit/js-lint-results.xml + + - name: Test + run: pnpm run test --ci --runInBand --reporters=default --reporters=jest-junit --coverage + env: + NODE_ENV: ci + JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" + + - uses: actions/upload-artifact@v4 + with: + name: reports + path: reports/junit + + - uses: actions/upload-artifact@v4 + with: + name: coverage + path: coverage + + diff --git a/README.md b/README.md index 0e623c82..bb6c4957 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > The most popular [Google Sheets API](https://developers.google.com/sheets/api/guides/concepts) wrapper for javascript / typescript [![NPM version](https://img.shields.io/npm/v/google-spreadsheet)](https://www.npmjs.com/package/google-spreadsheet) -[![CircleCI](https://circleci.com/gh/theoephraim/node-google-spreadsheet.svg?style=shield)](https://circleci.com/gh/theoephraim/node-google-spreadsheet) +[![CI status](https://github.com/theoephraim/node-google-spreadsheet/actions/workflows/ci.yml/badge.svg)](https://github.com/theoephraim/node-google-spreadsheet/actions/workflows/ci.yml) [![Known Vulnerabilities](https://snyk.io/test/github/theoephraim/node-google-spreadsheet/badge.svg?targetFile=package.json)](https://snyk.io/test/github/theoephraim/node-google-spreadsheet?targetFile=package.json) [![NPM](https://img.shields.io/npm/dw/google-spreadsheet)](https://www.npmtrends.com/google-spreadsheet)