From a7e768b5bd530fbb4023d50c9a683160bcb461ab Mon Sep 17 00:00:00 2001 From: Jordan Baker Date: Fri, 19 Jan 2024 09:40:31 -0700 Subject: [PATCH] Switch CI from CircleCI to GitHub Actions --- .circleci/config.yml | 24 -------------------- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 24 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 95f0433..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: node:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "package.json" }} - - run: - name: install - command: npm ci - - save_cache: - key: dependency-cache-{{ checksum "package.json" }} - paths: - - ./node_modules - - run: - name: test - command: npm run test:ci - - store_test_results: - path: junit.xml - - store_artifacts: - path: junit.xml - destination: tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d1d2c1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: Node.js CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} + restore-keys: ${{ runner.os }}-node- + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test:ci + + - name: Upload test results + uses: actions/upload-artifact@v2 + if: failure() + with: + name: junit + path: junit.xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}