Skip to content

Commit 2d99c49

Browse files
committed
Migrate from travis ci to github actions
1 parent 50008e5 commit 2d99c49

File tree

5 files changed

+46
-52
lines changed

5 files changed

+46
-52
lines changed

.github/workflows/ci.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
env:
3+
DB_USER: session_test
4+
DB_PASS: session_test
5+
DB_NAME: session_test
6+
on:
7+
push:
8+
jobs:
9+
ci:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node: [12, 14, 16]
14+
services:
15+
mysql:
16+
image: mysql:5.7
17+
ports:
18+
- 3306
19+
env:
20+
MYSQL_DATABASE: ${{ env.DB_NAME }}
21+
MYSQL_USER: ${{ env.DB_USER }}
22+
MYSQL_PASSWORD: ${{ env.DB_PASS }}
23+
MYSQL_RANDOM_ROOT_PASSWORD: 1
24+
options: >-
25+
--health-cmd="mysqladmin ping"
26+
--health-interval=10s
27+
--health-timeout=5s
28+
--health-retries=3
29+
steps:
30+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
31+
uses: actions/checkout@v2
32+
- name: Setup node
33+
uses: actions/setup-node@v2
34+
with:
35+
node-version: ${{ matrix.node }}
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Run Tests
39+
env:
40+
DB_HOST: mysql
41+
DB_PORT: ${{ job.services.mysql.ports[3306] }}
42+
run: npm run test

.github/workflows/node.js.yml

-29
This file was deleted.

.travis.yml

-17
This file was deleted.

package.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"version": "2.1.6",
55
"main": "index.js",
66
"scripts": {
7-
"benchmarks": "./node_modules/.bin/mocha test/benchmarks/ --recursive --reporter spec --ui bdd",
7+
"benchmarks": "./node_modules/.bin/mocha test/benchmarks/ --recursive --reporter spec --ui bdd --exit",
88
"lint": "./node_modules/.bin/eslint --config .eslintrc.js *.js test/**/*.js",
9-
"prepare": "npm run test",
10-
"pretest": "npm run lint",
119
"test": "npm run test:unit && npm run test:integration",
12-
"test:integration": "./node_modules/.bin/mocha test/integration/ --recursive --reporter spec --ui bdd",
13-
"test:unit": "./node_modules/.bin/mocha test/unit/ --recursive --reporter spec --ui bdd"
10+
"test:integration": "./node_modules/.bin/mocha test/integration/ --recursive --reporter spec --ui bdd --exit",
11+
"test:unit": "./node_modules/.bin/mocha test/unit/ --recursive --reporter spec --ui bdd --exit"
1412
},
1513
"repository": {
1614
"type": "git",

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A MySQL session store for [express.js](http://expressjs.com/).
44

5-
[![Build Status](https://travis-ci.org/chill117/express-mysql-session.svg?branch=master)](https://travis-ci.org/chill117/express-mysql-session)
5+
![Build Status](https://github.com/chill117/express-mysql-session/actions/workflows/ci.yml/badge.svg)
66

77
* [Installation](#installation)
88
* [Important Notes](#important-notes)

0 commit comments

Comments
 (0)