Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
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 ESLint
run: npm run lint

- name: Lint Flow
run: npm run check

- name: Lint Prettier
run: npm run prettier:check

- name: Spellcheck
run: npm run check:spelling

checkForCommonlyIgnoredFiles:
name: Check for commonly ignored files
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Check if commit contains files that should be ignored
run: |
git clone --depth 1 https://github.com/github/gitignore.git &&
cat gitignore/Node.gitignore $(find gitignore/Global -name "*.gitignore" | grep -v ModelSim) > all.gitignore &&
if [[ "$(git ls-files -iX all.gitignore)" != "" ]]; then
echo "::error::Please remove these files:"
git ls-files -iX all.gitignore
exit 1
fi

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 Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage-final.json
fail_ci_if_error: true

test:
name: Run tests on Node v${{ matrix.node_version_to_setup }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version_to_setup: [12, 14, 15]
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
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a library to allow the easy creation of Relay-compliant servers using the [GraphQL.js](https://github.com/graphql/graphql-js) reference implementation of a GraphQL server.

[![Build Status](https://travis-ci.org/graphql/graphql-relay-js.svg?branch=master)](https://travis-ci.org/graphql/graphql-relay-js)
[![Build Status](https://github.com/graphql/graphql-relay-js/workflows/CI/badge.svg?branch=main)](https://github.com/graphql/graphql-relay-js/actions?query=branch%3Amain)
[![Coverage Status](https://codecov.io/gh/graphql/graphql-relay-js/branch/master/graph/badge.svg)](https://codecov.io/gh/graphql/graphql-relay-js)

## Getting Started
Expand Down