1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

tests: setup GitHub Actions to replace Travis (#1497)

Additionally adds testing against many Node.js versions and Redis versions.
This commit is contained in:
Mike Diarmid
2020-02-11 00:17:09 +00:00
committed by GitHub
parent 61318e6ed6
commit f2050f9daf
13 changed files with 204 additions and 62 deletions

38
.github/workflows/benchmark.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Benchmarking
on: [pull_request]
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [8.x, 10.x, 12.x]
redis-version: [5]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1.0.1
with:
redis-version: ${{ matrix.redis-version }}
auto-start: "true"
- run: npm i --no-audit --prefer-offline
- name: Run Benchmark
run: npm run benchmark > benchmark-output.txt && cat benchmark-output.txt
- name: Upload Benchmark Result
uses: actions/upload-artifact@v1
with:
name: benchmark-output.txt
path: benchmark-output.txt

31
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Linting
on: [pull_request]
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm i --no-audit --prefer-offline
- name: Test Code Linting
run: npm run lint
- name: Save Code Linting Report JSON
run: npm run lint:report
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@1.0.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint-report.json"
- name: Upload ESLint report
uses: actions/upload-artifact@v1
with:
name: eslint-report.json
path: eslint-report.json

52
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Tests
on: [pull_request]
jobs:
testing:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [6.x, 8.x, 10.x, 12.x]
redis-version: [4.x, 5.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1.0.1
with:
redis-version: ${{ matrix.redis-version }}
auto-start: "false"
- name: Disable IPv6
run: sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
- name: Setup Stunnel
run: sudo apt-get install stunnel4
- name: Install Packages
run: npm i --no-audit --prefer-offline
- name: Run Tests
run: npm test
- name: Submit Coverage
run: npm run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
- name: Upload Coverage Report
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage

49
.github/workflows/tests_windows.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Tests Windows
on: [pull_request]
jobs:
testing-windows:
name: Test Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
node-version: [6.x, 8.x, 10.x, 12.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Redis
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install redis-64 --no-progress
- name: Start Redis
run: |
redis-server --service-install
redis-server --service-start
redis-cli config set stop-writes-on-bgsave-error no
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Packages
run: npm i --no-audit --prefer-offline
- name: Run Tests
run: npm test
- name: Submit Coverage
run: npm run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
- name: Upload Coverage Report
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage