mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
83 lines
3.2 KiB
YAML
83 lines
3.2 KiB
YAML
environment:
|
|
PATH: C:\msys64\usr\bin;C:\msys64\mingw64\bin;%PATH%
|
|
CASK_PYTHON: C:\Python27\python
|
|
JUPYTER_PYTHON_VERSION: 3.6
|
|
MINICONDA: C:\Miniconda3-x64
|
|
EZMQ_VERSION: v0.10.1
|
|
EZMQ_TZG: emacs-zmq-x86_64-w64-mingw32.tar.gz
|
|
matrix:
|
|
fast_finish: true
|
|
cache:
|
|
- C:\msys64\var\cache\pacman\pkg
|
|
- C:\Miniconda3-x64\envs\jupyter
|
|
install:
|
|
- pacman --needed --noconfirm -Syu
|
|
- pacman --needed --noconfirm -Sy
|
|
- pacman --needed --noconfirm -S mingw-w64-x86_64-emacs
|
|
# Install Cask
|
|
# NOTE: Using bash here so that cask writes to ~/.cask
|
|
- bash -lc "curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | $CASK_PYTHON"
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
|
- ps: |
|
|
Add-Content -Path run-cask -Value @'
|
|
#!/usr/bin/env bash
|
|
$CASK_PYTHON ~/.cask/bin/cask $@ 2>&1
|
|
'@
|
|
- chmod +x run-cask
|
|
- set PATH=%APPVEYOR_BUILD_FOLDER%;%PATH%
|
|
- set CASK=run-cask
|
|
# Install Jupyter
|
|
- '"%MINICONDA%\Scripts\activate.bat"'
|
|
- conda config --set always_yes yes --set changeps1 no
|
|
- if not exist C:\Miniconda3-x64\envs\jupyter conda create --name jupyter python=%JUPYTER_PYTHON_VERSION%
|
|
- conda activate jupyter
|
|
- conda install jupyter
|
|
# Ensure Jupyter runtime dir can be written to
|
|
- ps: mkdir -p (jupyter --runtime-dir)
|
|
build_script:
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
|
- make dev
|
|
# Download emacs-zmq dll binaries
|
|
- ps: cd (Get-ChildItem -Recurse -Depth 2 -Path .cask -Filter zmq-*).FullName
|
|
- appveyor DownloadFile https://github.com/dzop/emacs-zmq/releases/download/%EZMQ_VERSION%/%EZMQ_TZG%
|
|
- tar -xzf %EZMQ_TZG%
|
|
# NOTE: Set PATH to include the ZMQ directory so that emacs-zmq.dll can find
|
|
# libzmq.dll and it needs to be at the front of PATH to ensure we find the
|
|
# right one. See
|
|
# https://docs.microsoft.com/en-us/windows/desktop/dlls/dynamic-link-library-search-order
|
|
# TODO: Make this unnecessary
|
|
- ps: $env:PATH = "$(Get-Location);$env:PATH"
|
|
test_script:
|
|
# NOTE: Running "cask exec cmd" calls os.execvp to "replace" the current
|
|
# process with one executing cmd. On Windows, a new process is created
|
|
# instead of replacing the current one and the old process is exited using a
|
|
# 0 exit code (see https://bugs.python.org/issue13792 and
|
|
# https://bugs.python.org/issue19124). The issue here is that Appveyor checks
|
|
# the exit code of the original process which always returns 0 even in the
|
|
# case of failure.
|
|
#
|
|
# Since "make test" calls "cask exec ert-runner" we have to add some extra
|
|
# complexity to be able to cause the build to fail when ert-runner fails.
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
|
- make compile
|
|
- ps: |
|
|
$make_test = Start-Job {
|
|
cd $env:APPVEYOR_BUILD_FOLDER
|
|
make test
|
|
}
|
|
# For some reason multiple Emacs processes are sometimes present.
|
|
$emacs = $null
|
|
while (!$emacs -or $emacs.Count -gt 1) {
|
|
Start-Sleep 1
|
|
$emacs = Get-Process emacs -ErrorAction SilentlyContinue
|
|
}
|
|
# Capture a handle to the process so that $emacs.ExitCode doesn't return
|
|
# $null when checked.
|
|
$handle = $emacs.Handle
|
|
$make_test | Receive-Job -Wait
|
|
$emacs_exitcode = $emacs.ExitCode
|
|
if ($emacs_exitcode -ne 0) {
|
|
throw "Tests failed"
|
|
} else {
|
|
Write-Host "Tests passed" -BackgroundColor green
|
|
}
|