Skip to content

Commit

Permalink
Rewrite CI from Travis to GitHub Actions (#31)
Browse files Browse the repository at this point in the history
* Rewrite ci/cd from travis to github actions

* delete mongo version 3.4

* add vazco open standards

* add custom name with Node.js and MongoDB versions

* stringify matrix number like 6.0
  • Loading branch information
ErnestTeluk authored Jul 21, 2023
1 parent 61f69f3 commit c1f0cb8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 34 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
CI:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
mongodb-version: [3.6, '4.0', 4.2, 4.4, '6.0']
name: Node.js ${{ matrix.node-version }}, MongoDB ${{ matrix.mongodb-version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check dependency duplications
uses: vazco/open-standards/actions/npm-dependency-duplications/@master
- name: Check dependency vulnerabilities
uses: vazco/open-standards/actions/npm-dependency-vulnerabilities/@master
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install dependencies
run: npm i -g npm@8 --no-audit && npm ci --no-audit
- name: Lint
run: npm run lint
- name: Test
run: npm run coverage -- --no-cache --runInBand
- name: Report coverage
uses: codecov/[email protected]
with:
fail_ci_if_error: true

29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<strong><a href="https://github.com/vazco/sparrowql/blob/master/.github/CONTRIBUTING.md">Contribute</a></strong> |
<strong><a href="#usage">Usage</a></strong> |
<strong><a href="https://github.com/vazco/sparrowql/blob/master/INTRODUCTION.md">Documentation</a></strong> |
<strong><a href="https://github.com/vazco/sparrowql/blob/master/FAQ.md">FAQ</a></strong>
<strong><a href="https://github.com/vazco/sparrowql/blob/master/FAQ.md">FAQ</a></strong>
</p>

<p align="center">
Expand All @@ -36,8 +36,8 @@
<a href="https://npmjs.org/package/sparrowql">
<img src="https://img.shields.io/npm/v/sparrowql.svg" alt="Version">
</a>
<a href="https://travis-ci.org/vazco/sparrowql">
<img src="https://img.shields.io/travis/vazco/sparrowql.svg" alt="Status">
<a href="https://github.com/vazco/sparrowql/actions?query=branch:master">
<img src="https://img.shields.io/github/actions/workflow/status/vazco/sparrowql/CI.yml.svg?branch=master" alt="Status">
</a>
</p>

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"scripts": {
"coverage": "jest --coverage",
"coverage:report": "codecov",
"lint": "npm run lint:code && npm run lint:types",
"lint:code": "eslint --cache --cache-location node_modules/.cache/eslint --cache-strategy content --ext js,ts .",
"lint:types": "tsc --build tsconfig.global.json",
Expand All @@ -16,7 +15,6 @@
"@types/jest": "27.4.1",
"@types/node": "17.0.21",
"@types/uuid": "8.3.4",
"codecov": "3.8.3",
"eslint-config-vazco": "6.2.0",
"graphql": "^16.0.0 || ^15.0.0",
"jest": "27.5.1",
Expand Down

0 comments on commit c1f0cb8

Please sign in to comment.