From 45ed16894eb69710234cbdd44ab56a0a3b6c3411 Mon Sep 17 00:00:00 2001 From: Daniel Bayley Date: Tue, 13 Oct 2020 13:10:45 +0100 Subject: [PATCH] Migrate CI to GitHub Actions --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 5 ----- circle.yml | 18 ------------------ package.json | 4 ++-- 4 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 circle.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cb29ce9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI +on: + push: + branches: master + pull_request: + +jobs: + test: + name: Node v${{ matrix.node-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node-version: [ 10.x, 12.x, 13.x, 14.x ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-node_modules- + ${{ runner.os }}- + + - run: npm install + + - run: npm test diff --git a/README.md b/README.md index 68eb82b..0753fcf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![badge][ci]][circle] - [_Jest_] + [CoffeeScript] ========================= Easily write your [_Jest_]s in CoffeeScript. @@ -29,9 +27,6 @@ License [MIT]: LICENSE.md [Daniel Bayley]: https://github.com/danielbayley -[ci]: https://img.shields.io/circleci/project/danielbayley/jest-preset-coffeescript.svg?style=flat-square -[circle]: https://circleci.com/gh/danielbayley/jest-preset-coffeescript - [_jest_]: https://facebook.github.io/jest [_transform_]: https://facebook.github.io/jest/docs/en/configuration.html#transform-object-string-string diff --git a/circle.yml b/circle.yml deleted file mode 100644 index bb69c9f..0000000 --- a/circle.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/node:13 - steps: - - checkout - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - - v1-dependencies- - - run: yarn install - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - - run: yarn test diff --git a/package.json b/package.json index 15b0c0d..94e6714 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "scripts": { "prepare": "coffee --compile --bare --transpile *.coffee", "precommit": "lint-staged", - "prepublishOnly": "CI=true npm test", + "prepublishOnly": "GITHUB_ACTIONS=true npm test", "prerelease": "git stash --include-untracked", "release": "npm version --", "postversion": "git push --follow-tags && npm publish && git stash pop --index", @@ -81,7 +81,7 @@ "test": "npm run test.lint && npm run test.jest", "test.lint": "npm run test.lint.coffee", "test.lint.coffee": "coffeelint -- *.coffee test/*.*coffee*", - "test.jest": "jest ${CI+--ci --all --no-cache}", + "test.jest": "jest ${GITHUB_ACTIONS+--ci --all --no-cache}", "clean": "rm -f jest-preset.js* & jest --clearCache --config {}" } }