Skip to content

Commit 71b1901

Browse files
authored
test(github-actions): migrate tests to GitHub Actions (#249)
test(github-actions): migrate tests to GitHub Actions Migrate PubNub SDK test suite from Travis to GitHub Actions.
1 parent b4b6376 commit 71b1901

3 files changed

Lines changed: 57 additions & 42 deletions

File tree

.github/workflows/commands-handler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: steps.user-check.outputs.expected-user == 'true'
2626
uses: actions/checkout@v3
2727
with:
28-
token: ${{ secrets.GH_TOKEN }}
28+
token: ${{ secrets.GH_TOKEN }}
2929
- name: Checkout release actions
3030
if: steps.user-check.outputs.expected-user == 'true'
3131
uses: actions/checkout@v3

.github/workflows/run-tests.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
defaults:
10+
run:
11+
shell: bash
12+
env:
13+
CXX: 'g++-4.8'
14+
15+
jobs:
16+
tests:
17+
name: Integration and Unit tests
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
node: [12, 14, 16]
23+
env: ["ci:node"]
24+
include:
25+
- node: 16
26+
env: "ci:web"
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
- name: Checkout actions
31+
uses: actions/checkout@v3
32+
with:
33+
repository: pubnub/client-engineering-deployment-tools
34+
ref: v1
35+
token: ${{ secrets.GH_TOKEN }}
36+
path: .github/.release/actions
37+
- name: Setup NodeJS ${{ matrix.node }}
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ matrix.node }}
41+
cache: 'npm'
42+
cache-dependency-path: '**/package-lock.json'
43+
- name: Build and run tests for NodeJS ${{ matrix.node }}
44+
run: |
45+
npm install
46+
npm run ${{ matrix.env }}
47+
- name: Cancel workflow runs for commit on error
48+
if: failure()
49+
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
50+
all-tests:
51+
name: Tests
52+
runs-on: ubuntu-latest
53+
needs: [tests]
54+
steps:
55+
- name: Tests summary
56+
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)