-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
741ab09
commit 2d5d02b
Showing
3 changed files
with
95 additions
and
97 deletions.
There are no files selected for viewing
16 changes: 12 additions & 4 deletions
16
.github/workflows/Python_tests.yml → .github/workflows/test-python.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [10.x, 12.x, 14.x] | ||
python: [2.7, 3.6, 3.7, 3.8] | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Set Env Vars | ||
run: | | ||
if [ "$PYTHON_VERSION" == 2.7 ]; then | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "::add-path::/c/Python27:/c/Python27/Scripts" | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::/c/Python27/python.exe" | ||
else | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::python2" | ||
fi | ||
elif [ "$PYTHON_VERSION" == 3.6 ]; then | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "::add-path::/c/Python36:/c/Python36/Scripts" | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::/c/Python36/python.exe" | ||
else | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::python3" | ||
fi | ||
elif [ "$PYTHON_VERSION" == 3.7 ]; then | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "::add-path::/c/Python37:/c/Python37/Scripts" | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::/c/Python37/python.exe" | ||
else | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::python3" | ||
fi | ||
elif [ "$PYTHON_VERSION" == 3.8 ]; then | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "::add-path::/c/Python38:/c/Python38/Scripts" | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::/c/Python38/python.exe" | ||
else | ||
echo "::set-env name=NODE_GYP_FORCE_PYTHON::python3" | ||
fi | ||
else | ||
echo "Nonexistent python version: $PYTHON_VERSION" | ||
exit 1 | ||
fi | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python }} | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade flake8 pytest==4.6.6 | ||
npm install | ||
- name: Lint Python | ||
run: | | ||
python -m flake8 --version | ||
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Run Tests | ||
run: | | ||
npm test | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest | ||
else | ||
python -m pytest | ||
fi |
This file was deleted.
Oops, something went wrong.