Skip to content

Commit

Permalink
Merge pull request #28 from theY4Kman/chore/github/actions-ci-playground
Browse files Browse the repository at this point in the history
  • Loading branch information
theY4Kman authored Jun 10, 2021
2 parents d0498bb + b7fad8f commit 3af391a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Integration tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pipenv
pipenv install --dev
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install redis-server
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '6.x'
auto-start: false
- run: npm ci
- run: npm run test:integration

26 changes: 26 additions & 0 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Mocha tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:unit

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prepare": "npm run build",
"test": "npm run test:unit; npm run test:integration",
"test:unit": "mocha",
"test:integration": "pipenv run py.test || true"
"test:integration": "pipenv run py.test"
},
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions test/integration/tests/mocha.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ def pytest_collection(session: pytest.Session):

session.items.append(test)

###
# NOTE: if this counter remains 0 at end of session, an exit code of 5 will be returned.
# This value is normally set by Session.perform_collect(), but we are bypassing that
# implementation.
#
session.testscollected = len(session.items)

return session.items


Expand Down

0 comments on commit 3af391a

Please sign in to comment.