Skip to content

Commit 2f87f90

Browse files
committed
Migrate CI to GitHub actions
1 parent 58c64c0 commit 2f87f90

File tree

5 files changed

+92
-68
lines changed

5 files changed

+92
-68
lines changed

.github/workflows/ci.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/cache@v2
10+
with:
11+
path: '**/node_modules'
12+
key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }}
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: 14.x
16+
- run: yarn install
17+
- run: yarn run lint
18+
19+
test:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest]
24+
node-version:
25+
- 12.x
26+
- 14.x
27+
- 16.x
28+
steps:
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v2
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
- name: Ensure line endings are consistent
34+
run: git config --global core.autocrlf input
35+
- name: Check out repository
36+
uses: actions/checkout@v2
37+
- uses: actions/cache@v2
38+
with:
39+
path: '**/node_modules'
40+
key: ${{ runner.os }}-test-modules-${{ hashFiles('**/yarn.lock') }}
41+
- name: Install dependencies
42+
run: yarn install
43+
- name: Run tests
44+
run: yarn run test-ci
45+
- name: Submit coverage results
46+
uses: coverallsapp/github-action@master
47+
with:
48+
github-token: ${{ secrets.github_token }}
49+
flag-name: run-${{ matrix.node-version }}
50+
parallel: true
51+
52+
coveralls:
53+
needs: test
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Consolidate test coverage from different jobs
57+
uses: coverallsapp/github-action@master
58+
with:
59+
github-token: ${{ secrets.github_token }}
60+
parallel-finished: true
61+
62+
docker:
63+
needs:
64+
- test
65+
- lint
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Use Node.js
69+
uses: actions/setup-node@v2
70+
with:
71+
node-version: '14.x'
72+
- name: Check out repository
73+
uses: actions/checkout@v2
74+
- name: Load cache
75+
uses: actions/cache@v2
76+
with:
77+
path: '**/node_modules'
78+
key: ${{ runner.os }}-docker-modules-v1-${{ hashFiles('**/yarn.lock') }}
79+
- name: Install dependencies
80+
run: yarn install --pure-lockfile
81+
- name: Install Lerna Docker
82+
run: sh -c "`curl -fsSl https://raw.githubusercontent.com/rubensworks/lerna-docker/master/install.sh`"
83+
- name: Build Docker images
84+
run: ~/.lerna-docker/bin/lerna-docker linkeddatafragments build
85+
- name: Deploy Docker images
86+
if: startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
87+
run: ~/.lerna-docker/bin/lerna-docker linkeddatafragments push
88+
env:
89+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
90+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

.travis.yml

-40
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Linked Data Fragments Server
22
<img src="http://linkeddatafragments.org/images/logo.svg" width="200" align="right" alt="" />
33

4-
[![Build Status](https://travis-ci.org/LinkedDataFragments/Server.js.svg?branch=master)](https://travis-ci.org/LinkedDataFragments/Server.js)
4+
[![Build status](https://github.com/LinkedDataFragments/Server.js/workflows/CI/badge.svg)](https://github.com/LinkedDataFragments/Server.js/actions?query=workflow%3ACI)
55
[![Coverage Status](https://coveralls.io/repos/github/LinkedDataFragments/Server.js/badge.svg?branch=master)](https://coveralls.io/github/LinkedDataFragments/Server.js?branch=master)
66
[![npm version](https://badge.fury.io/js/%40ldf%2Fserver.svg)](https://www.npmjs.com/package/@ldf/server)
77
[![DOI](https://zenodo.org/badge/16891600.svg)](https://zenodo.org/badge/latestdoi/16891600)

greenkeeper.json

-26
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"lint-changed": "lerna run lint --since HEAD",
3131
"mocha": "mocha \"packages/*/test/**/*-test.js\" --recursive --require ./test/test-setup --timeout 500",
3232
"test": "nyc npm run mocha",
33-
"coveralls": "nyc --reporter=text-lcov npm run mocha | coveralls",
33+
"test-ci": "nyc --reporter=lcov npm run mocha",
3434
"lint": "eslint packages/*/bin/* packages/*/lib packages/*/test",
3535
"clean": "rm -rf ./node_modules && rm -rf ./packages/*/node_modules",
3636
"publish": "lerna publish",

0 commit comments

Comments
 (0)