Skip to content

Commit

Permalink
Add GitHub Action to run tests #151
Browse files Browse the repository at this point in the history
  • Loading branch information
kynan committed May 8, 2021
1 parent 908870a commit 83c88e9
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: nbstripout

on: [push]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [windows-latest]
# python-version: [3.5, 3.6, 3.7, 3.8]
python-version: [3.5]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools wheel
# traitlets 4 does not support Python < 3.7
python -m pip install pytest 'traitlets<5' nbformat
python setup.py install
- name: Configure Git
run: git config --global init.defaultBranch main
- name: Run tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
python setup.py test
- name: Run tests (MacOS)
if: matrix.os == 'macos-latest'
run: |
# Ignore test-hg.t as Mercurial is not installed
echo 'cramignore = test-hg.t' >> pytest.ini
python setup.py test
- name: Windows specific configuration
if: matrix.os == 'windows-latest'
shell: bash
env:
NBSTRIPOUT_EXE: ${{ env.pythonLocation }}\Scripts\nbstripout.exe
run: |
env
git config --global core.autocrlf true
echo NBSTRIPOUT_EXE=${NBSTRIPOUT_EXE}
${NBSTRIPOUT_EXE} --help

0 comments on commit 83c88e9

Please sign in to comment.