From ba691e1859dc1b5f03a5ff091de2d41b24f7d21f Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Sat, 13 Jun 2020 22:57:58 +0300 Subject: [PATCH] Switch to GitHub Actions --- .github/workflows/ci.yml | 95 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 30 ------------- README.md | 3 +- 3 files changed, 97 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b21e0239 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI +on: [push, pull_request] +env: + NODE_VERSION_USED_FOR_DEVELOPMENT: 14 +jobs: + lint: + name: Lint source files + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }} + + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + + - name: Install Dependencies + run: npm ci + + - name: Lint Prettier + run: npm run prettier:check + + - name: Lint ESLint + run: npm run lint + + - name: Lint Flow + run: npm run check + + coverage: + name: Measure test coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }} + + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + + - name: Install Dependencies + run: npm ci + + - name: Run tests and measure code coverage + run: npm run testonly:cover + + - name: Upload coverage to Coveralls + if: ${{ always() }} + run: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + + test: + name: Run tests on Node v${{ matrix.node_version_to_setup }} + runs-on: ubuntu-latest + strategy: + matrix: + node_version_to_setup: [10, 12, 14] + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Node.js v${{ matrix.node_version_to_setup }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version_to_setup }} + + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + + - name: Install Dependencies + run: npm ci + + - name: Run Tests + run: npm run testonly diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b454e733..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -git: - depth: 5 -language: node_js -cache: yarn - -# https://github.com/nodejs/Release -node_js: - - '14' - - '13' - - '12' - - '10' - -script: | - if [[ "$(node -pe process.version)" == v10.* ]]; then # Is latest LTS? - npm run test:ci && - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - else - npm run testonly - fi - -notifications: - irc: - use_notice: true - on_success: change - on_failure: change - skip_join: true - channels: - - 'chat.freenode.net#graphql' - slack: - secure: eFMk+9i9G0F8VYd0cd+qfBXEcngR1odYzGapdSSPH0Ag6Ck1sjK64n0iFwz+RDV2sSVnjnAA5qbXNcltBhEe1DkNsZVXOp4cDxKiFQOH1NJu9m29rYx+dZ4H93JjuDtH0u2o2op/PhtXlwAjr8GBcdGgFNTUbiJv9nIj4sYudQJFL8VUQwYviRO28xx12hG7cmKvQ7YZ/OKz52oGnIOM4yoQgPKFRY4ztMr6OrHwDwWMAxptZjKYY0i2hE3ot+OkWeWteZvE9E2Q0OJI7C6XlZg+bR6Mu7VS5s6jjL21luJJBgwihLuWVNMXxxEfoUCldo0s/RX8lObuFocKpnAtqVimr1rPZtUYZzy/Jjd1fxa27TgONZUgibWoRbAFDCdKhJOsBSLGfvQw+a3sxkV5zD5DKpgaNavT+GbOZJn4KGw3i1M/5Gp1tqB+RsTMjRvXQH5rsc+9z/flys1K9sNrc7O0NS2sVPayf4U5ECgT6t0y6NM1hQNepNHbvPSU/I/dUPYQEMcWMtdgtApAeUcbsRFUgFejNwp4hhTz0MS6k9AtmLJ79mNQBqDgZ3/pnW/YjW7BsK8/f6xOabxJjwIdLJvAifxRy/oj8wd5ttx8u+qKZ547PhdNJiMV7H60tGqkJshqbphlvWr48l0EV0A635uY24VefYoTeMIXZSeueME= diff --git a/README.md b/README.md index 48eb8367..b10feb51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GraphQL HTTP Server Middleware -[![Build Status](https://travis-ci.org/graphql/express-graphql.svg?branch=master)](https://travis-ci.org/graphql/express-graphql) +[![npm version](https://badge.fury.io/js/express-graphql.svg)](https://badge.fury.io/js/express-graphql) +[![Build Status](https://github.com/graphql/express-graphql/workflows/CI/badge.svg?branch=master)](https://github.com/graphql/express-graphql/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/graphql/express-graphql/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql/express-graphql?branch=master) Create a GraphQL HTTP server with any HTTP web framework that supports connect styled middleware, including [Connect](https://github.com/senchalabs/connect) itself, [Express](https://expressjs.com) and [Restify](http://restify.com/).