diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a871d19 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 \ No newline at end of file