Explorar o código

[azure-pipelines] initial working config

Andy Li %!s(int64=6) %!d(string=hai) anos
pai
achega
244381def2

+ 1 - 0
.gitignore

@@ -8,6 +8,7 @@
 *.a
 *.a
 *.exe
 *.exe
 .*.swp
 .*.swp
+.haxelib
 /out
 /out
 /installer
 /installer
 
 

+ 14 - 11
Makefile

@@ -22,6 +22,7 @@ MAKEFILENAME?=Makefile
 PLATFORM?=unix
 PLATFORM?=unix
 
 
 OUTPUT=haxe
 OUTPUT=haxe
+HAXELIB_OUTPUT=haxelib
 PREBUILD_OUTPUT=prebuild
 PREBUILD_OUTPUT=prebuild
 EXTENSION=
 EXTENSION=
 LFLAGS=
 LFLAGS=
@@ -83,7 +84,7 @@ COMMIT_DATE=$(shell \
 	fi \
 	fi \
 )
 )
 PACKAGE_FILE_NAME=haxe_$(COMMIT_DATE)_$(COMMIT_SHA)
 PACKAGE_FILE_NAME=haxe_$(COMMIT_DATE)_$(COMMIT_SHA)
-HAXE_VERSION=$(shell $(OUTPUT) -version 2>&1 | awk '{print $$1;}')
+HAXE_VERSION=$(shell $(CURDIR)/$(OUTPUT) -version 2>&1 | awk '{print $$1;}')
 HAXE_VERSION_SHORT=$(shell echo "$(HAXE_VERSION)" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+")
 HAXE_VERSION_SHORT=$(shell echo "$(HAXE_VERSION)" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+")
 
 
 # using $(CURDIR) on Windows will not work since it might be a Cygwin path
 # using $(CURDIR) on Windows will not work since it might be a Cygwin path
@@ -189,18 +190,18 @@ endif
 
 
 haxelib:
 haxelib:
 	(cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(OUTPUT) client.hxml && nekotools boot run.n)
 	(cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(OUTPUT) client.hxml && nekotools boot run.n)
-	mv extra/haxelib_src/run$(EXTENSION) haxelib$(EXTENSION)
+	mv extra/haxelib_src/run$(EXTENSION) $(HAXELIB_OUTPUT)
 
 
 tools: haxelib
 tools: haxelib
 
 
 install: uninstall
 install: uninstall
 	mkdir -p "$(DESTDIR)$(INSTALL_BIN_DIR)"
 	mkdir -p "$(DESTDIR)$(INSTALL_BIN_DIR)"
-	cp haxe haxelib "$(DESTDIR)$(INSTALL_BIN_DIR)"
+	cp $(OUTPUT) $(HAXELIB_OUTPUT) "$(DESTDIR)$(INSTALL_BIN_DIR)"
 	mkdir -p "$(DESTDIR)$(INSTALL_STD_DIR)"
 	mkdir -p "$(DESTDIR)$(INSTALL_STD_DIR)"
 	cp -r std/* "$(DESTDIR)$(INSTALL_STD_DIR)"
 	cp -r std/* "$(DESTDIR)$(INSTALL_STD_DIR)"
 
 
 uninstall:
 uninstall:
-	rm -rf $(DESTDIR)$(INSTALL_BIN_DIR)/haxe $(DESTDIR)$(INSTALL_BIN_DIR)/haxelib
+	rm -rf $(DESTDIR)$(INSTALL_BIN_DIR)/$(OUTPUT) $(DESTDIR)$(INSTALL_BIN_DIR)/$(HAXELIB_OUTPUT)
 	if [ -d "$(DESTDIR)$(INSTALL_LIB_DIR)/lib" ] && find "$(DESTDIR)$(INSTALL_LIB_DIR)/lib" -mindepth 1 -print -quit | grep -q .; then \
 	if [ -d "$(DESTDIR)$(INSTALL_LIB_DIR)/lib" ] && find "$(DESTDIR)$(INSTALL_LIB_DIR)/lib" -mindepth 1 -print -quit | grep -q .; then \
 		echo "The local haxelib repo at $(DESTDIR)$(INSTALL_LIB_DIR)/lib will not be removed. Remove it manually if you want."; \
 		echo "The local haxelib repo at $(DESTDIR)$(INSTALL_LIB_DIR)/lib will not be removed. Remove it manually if you want."; \
 		find $(DESTDIR)$(INSTALL_LIB_DIR)/ ! -name 'lib' -mindepth 1 -maxdepth 1 -exec rm -rf {} +; \
 		find $(DESTDIR)$(INSTALL_LIB_DIR)/ ! -name 'lib' -mindepth 1 -maxdepth 1 -exec rm -rf {} +; \
@@ -234,7 +235,7 @@ package_unix:
 	ocaml -version > _build/ocaml.version
 	ocaml -version > _build/ocaml.version
 	# Copy the package contents to $(PACKAGE_FILE_NAME)
 	# Copy the package contents to $(PACKAGE_FILE_NAME)
 	mkdir -p $(PACKAGE_FILE_NAME)
 	mkdir -p $(PACKAGE_FILE_NAME)
-	cp -r $(OUTPUT) haxelib$(EXTENSION) std extra/LICENSE.txt extra/CONTRIB.txt extra/CHANGES.txt _build $(PACKAGE_FILE_NAME)
+	cp -r $(OUTPUT) $(HAXELIB_OUTPUT) std extra/LICENSE.txt extra/CONTRIB.txt extra/CHANGES.txt _build $(PACKAGE_FILE_NAME)
 	# archive
 	# archive
 	tar -zcf $(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.tar.gz $(PACKAGE_FILE_NAME)
 	tar -zcf $(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.tar.gz $(PACKAGE_FILE_NAME)
 	rm -r $(PACKAGE_FILE_NAME)
 	rm -r $(PACKAGE_FILE_NAME)
@@ -242,10 +243,12 @@ package_unix:
 package_bin: package_$(PLATFORM)
 package_bin: package_$(PLATFORM)
 
 
 xmldoc:
 xmldoc:
-	haxelib path hxcpp  || haxelib git hxcpp  https://github.com/HaxeFoundation/hxcpp
-	haxelib path hxjava || haxelib git hxjava https://github.com/HaxeFoundation/hxjava
-	haxelib path hxcs   || haxelib git hxcs   https://github.com/HaxeFoundation/hxcs
-	cd extra && haxe doc.hxml
+	cd extra && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) newrepo && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) git hxcpp  https://github.com/HaxeFoundation/hxcpp   && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) git hxjava https://github.com/HaxeFoundation/hxjava  && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) git hxcs   https://github.com/HaxeFoundation/hxcs    && \
+	PATH="$(CURDIR):$(PATH)" $(CURDIR)/$(OUTPUT) doc.hxml
 
 
 $(INSTALLER_TMP_DIR):
 $(INSTALLER_TMP_DIR):
 	mkdir -p $(INSTALLER_TMP_DIR)
 	mkdir -p $(INSTALLER_TMP_DIR)
@@ -258,7 +261,7 @@ $(INSTALLER_TMP_DIR)/neko-osx64.tar.gz: $(INSTALLER_TMP_DIR)
 package_installer_mac: $(INSTALLER_TMP_DIR)/neko-osx64.tar.gz package_unix
 package_installer_mac: $(INSTALLER_TMP_DIR)/neko-osx64.tar.gz package_unix
 	$(eval OUTFILE := $(shell pwd)/$(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_installer.tar.gz)
 	$(eval OUTFILE := $(shell pwd)/$(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_installer.tar.gz)
 	$(eval PACKFILE := $(shell pwd)/$(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.tar.gz)
 	$(eval PACKFILE := $(shell pwd)/$(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.tar.gz)
-	$(eval VERSION := $(shell haxe -version 2>&1))
+	$(eval VERSION := $(shell $(CURDIR)/$(OUTPUT) -version 2>&1))
 	$(eval NEKOVER := $(shell neko -version 2>&1))
 	$(eval NEKOVER := $(shell neko -version 2>&1))
 	bash -c "rm -rf $(INSTALLER_TMP_DIR)/{resources,pkg,tgz,haxe.tar.gz}"
 	bash -c "rm -rf $(INSTALLER_TMP_DIR)/{resources,pkg,tgz,haxe.tar.gz}"
 	mkdir $(INSTALLER_TMP_DIR)/resources
 	mkdir $(INSTALLER_TMP_DIR)/resources
@@ -310,7 +313,7 @@ clean_haxe:
 	rm -f -r _build $(OUTPUT) $(PREBUILD_OUTPUT)
 	rm -f -r _build $(OUTPUT) $(PREBUILD_OUTPUT)
 
 
 clean_tools:
 clean_tools:
-	rm -f $(OUTPUT) $(PREBUILD_OUTPUT) haxelib
+	rm -f $(OUTPUT) $(PREBUILD_OUTPUT) $(HAXELIB_OUTPUT)
 
 
 clean_package:
 clean_package:
 	rm -rf $(PACKAGE_OUT_DIR)
 	rm -rf $(PACKAGE_OUT_DIR)

+ 9 - 3
Makefile.win

@@ -2,6 +2,7 @@ PLATFORM=win
 MAKEFILENAME=Makefile.win
 MAKEFILENAME=Makefile.win
 include Makefile
 include Makefile
 OUTPUT=haxe.exe
 OUTPUT=haxe.exe
+HAXELIB_OUTPUT=haxelib.exe
 PREBUILD_OUTPUT=prebuild.exe
 PREBUILD_OUTPUT=prebuild.exe
 EXTENSION=.exe
 EXTENSION=.exe
 PACKAGE_SRC_EXTENSION=.zip
 PACKAGE_SRC_EXTENSION=.zip
@@ -36,7 +37,10 @@ CC_CMD=($(COMPILER) $(ALL_CFLAGS) -c $< 2>tmp.cmi && $(FILTER)) || ($(FILTER) &&
 CC_PARSER_CMD=($(COMPILER) -pp camlp4o $(ALL_CFLAGS) -c src/syntax/parser.ml 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
 CC_PARSER_CMD=($(COMPILER) -pp camlp4o $(ALL_CFLAGS) -c src/syntax/parser.ml 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
 endif
 endif
 
 
-PACKAGE_FILES=$(OUTPUT) haxelib$(EXTENSION) std _build "$$(cygpath -w "$$(which zlib1.dll)")" "$$(cygpath -w "$$(which libpcre-1.dll)")"
+PACKAGE_FILES=$(OUTPUT) $(HAXELIB_OUTPUT) std _build "$$(cygcheck $(CURDIR)/$(OUTPUT) | grep zlib1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(OUTPUT) | grep libpcre-1.dll | sed -e 's/^\s*//')"
+
+echo_package_files:
+	echo $(PACKAGE_FILES)
 
 
 package_win:
 package_win:
 	mkdir -p out
 	mkdir -p out
@@ -81,8 +85,10 @@ package_installer_win: $(INSTALLER_TMP_DIR)/neko-win.zip package_win
 	7z x -y $(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.zip -o$(INSTALLER_TMP_DIR)/resources
 	7z x -y $(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_bin.zip -o$(INSTALLER_TMP_DIR)/resources
 	mv $(INSTALLER_TMP_DIR)/resources/haxe* $(INSTALLER_TMP_DIR)/resources/haxe
 	mv $(INSTALLER_TMP_DIR)/resources/haxe* $(INSTALLER_TMP_DIR)/resources/haxe
 	# haxesetup.exe
 	# haxesetup.exe
-	haxelib path hxcpp || haxelib install hxcpp
-	cd extra; haxelib run hxcpp build-haxesetup.xml
+	cd extra && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) newrepo && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) install hxcpp --quiet && \
+	$(CURDIR)/$(HAXELIB_OUTPUT) run hxcpp build-haxesetup.xml
 	cp extra/haxesetup.exe $(INSTALLER_TMP_DIR)/resources/haxe
 	cp extra/haxesetup.exe $(INSTALLER_TMP_DIR)/resources/haxe
 	# extra
 	# extra
 	cp extra/*.nsi $(INSTALLER_TMP_DIR)
 	cp extra/*.nsi $(INSTALLER_TMP_DIR)

+ 531 - 0
azure-pipelines.yml

@@ -0,0 +1,531 @@
+variables:
+  - group: variables-haxe
+  - name: AZURE_PIPELINES_REPO_URL
+    value: $(Build.Repository.Uri)
+  - name: AZURE_PIPELINES_BRANCH
+    value: $(Build.SourceBranchName)
+
+stages:
+  - stage: BuildAndTest
+    jobs:
+      - job: BuildLinux
+        pool:
+          vmImage: 'ubuntu-16.04'
+        variables:
+          OPAMYES: 1
+          ADD_REVISION: 1
+        steps:
+          - checkout: self
+            submodules: recursive
+          - script: |
+              set -ex
+              sudo add-apt-repository ppa:avsm/ppa -y # provides newer version of OCaml and OPAM
+              sudo apt-get update -qqy
+              sudo apt-get install -qqy ocaml-nox camlp4-extra opam libpcre3-dev zlib1g-dev libgtk2.0-dev ninja-build
+            displayName: Install dependencies
+          - script: |
+              set -ex
+              unset MACHINE RELEASE SYSTEM VERSION # https://marc.info/?l=gentoo-commits&m=155026142713994
+              mkdir $HOME/neko
+              pushd $HOME/neko
+              git clone --recursive https://github.com/HaxeFoundation/neko.git .
+              cmake . -DSTATIC_DEPS=all -G Ninja
+              ninja download_static_deps || ninja download_static_deps || ninja download_static_deps
+              ninja
+              sudo ninja install
+              popd
+            displayName: Install Neko
+          - script: |
+              set -ex
+              opam init
+              opam update
+              opam pin add haxe . --no-action
+              opam install haxe --deps-only
+              opam list
+              ocamlopt -v
+            displayName: Install OCaml libraries
+          - script: |
+              set -ex
+              opam config exec -- make -s STATICLINK=1 libs
+              opam config exec -- make -s STATICLINK=1 prebuild
+              opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
+              opam config exec -- make -s haxelib
+              make -s package_bin
+              ls -l out
+              ldd -v ./haxe
+              ldd -v ./haxelib
+            displayName: Build Haxe
+          - task: PublishPipelineArtifact@0
+            inputs:
+              artifactName: 'linuxBinaries'
+              targetPath: out
+          - script: |
+              set -ex
+              make -s xmldoc
+              cat >extra/doc/info.json <<EOL
+                {
+                  "commit": "$(Build.SourceVersion)",
+                  "branch": "$(Build.SourceBranchName)"
+                }
+              EOL
+            displayName: Build xmldoc
+          - task: PublishPipelineArtifact@0
+            inputs:
+              artifactName: 'xmldoc'
+              targetPath: extra/doc
+
+      - job: BuildMac
+        pool:
+          vmImage: 'macOS-10.13'
+        variables:
+          OPAMYES: 1
+          ADD_REVISION: 1
+        steps:
+          - checkout: self
+            submodules: recursive
+          - script: |
+              set -ex
+              brew update
+              brew bundle --file=tests/Brewfile --no-upgrade
+            displayName: Install dependencies
+          - script: |
+              set -ex
+              mkdir $HOME/neko
+              pushd $HOME/neko
+              git clone --recursive https://github.com/HaxeFoundation/neko.git .
+              cmake . -DSTATIC_DEPS=all -G Ninja
+              ninja download_static_deps || ninja download_static_deps || ninja download_static_deps
+              ninja -j 4
+              sudo ninja install
+              popd
+            displayName: Install Neko
+          - script: |
+              set -ex
+              opam init
+              opam update
+              opam pin add haxe . --no-action
+              opam install haxe --deps-only
+              opam list
+              ocamlopt -v
+            displayName: Install OCaml libraries
+          - script: |
+              set -ex
+              opam config exec -- make -s STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" libs
+              opam config exec -- make -s STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" prebuild
+              opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" haxe
+              opam config exec -- make -s haxelib
+              make -s package_bin package_installer_mac
+              ls -l out
+              otool -L ./haxe
+              otool -L ./haxelib
+            displayName: Build Haxe
+          - task: PublishPipelineArtifact@0
+            inputs:
+              artifactName: 'macBinaries'
+              targetPath: out
+
+      - job: BuildWindows
+        pool:
+          vmImage: 'windows-2019'
+        variables:
+          OPAMYES: 1
+          ADD_REVISION: 1
+          CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
+        strategy:
+          matrix:
+            x64:
+              ARCH: 64
+              MINGW_ARCH: x86_64
+              CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe
+              CYG_ROOT: C:/cygwin64
+            x86:
+              ARCH: 32
+              MINGW_ARCH: i686
+              CYGWIN_SETUP: https://cygwin.com/setup-x86.exe
+              CYG_ROOT: C:/cygwin
+        steps:
+          - checkout: self
+            submodules: recursive
+          - powershell: |
+              Set-PSDebug -Trace 1
+              choco install --no-progress nsis.portable --version 3.02 -y
+              choco install --no-progress curl wget 7zip.portable -y
+            displayName: Install dependencies
+          - powershell: |
+              Set-PSDebug -Trace 1
+              choco install --no-progress neko --prerelease --ignore-dependencies -s 'https://ci.appveyor.com/nuget/neko' -y
+              neko -version
+              Set-PSDebug -Trace 0
+              Write-Host "##vso[task.setvariable variable=NEKOPATH]C:/ProgramData/chocolatey/lib/neko"
+            displayName: Install Neko
+          - powershell: |
+              Set-PSDebug -Trace 1
+              curl.exe -fsSL -o cygwin-setup.exe --retry 3 $(CYGWIN_SETUP)
+              Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $(CYG_ROOT) -l C:/tmp -s $(CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mingw64-$(MINGW_ARCH)-zlib -P mingw64-$(MINGW_ARCH)-gcc-core -P mingw64-$(MINGW_ARCH)-pcre" -Wait
+              curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$(ARCH).tar.xz
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam$(ARCH)/install.sh')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw$(ARCH)c --switch 4.07.0+mingw$(ARCH)c --auto-setup --yes 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
+            displayName: Install OCaml and OCaml libraries
+          - powershell: Write-Host "##vso[task.prependpath]${env:CYG_ROOT}/usr/$(MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
+            displayName: Expose mingw dll files
+          - powershell: |
+              Set-PSDebug -Trace 1
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win libs prebuild 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco 2>&1')
+              dir out
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
+              & "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
+            displayName: Build Haxe
+          - task: PublishPipelineArtifact@0
+            inputs:
+              artifactName: 'win$(ARCH)Binaries'
+              targetPath: out
+
+      - job: TestLinux
+        dependsOn: BuildLinux
+        pool:
+          vmImage: 'ubuntu-16.04'
+        strategy:
+          matrix:
+            macro:
+              TEST: macro
+            neko:
+              TEST: neko
+            hl:
+              TEST: hl
+              APT_PACKAGES: cmake ninja-build
+            cpp:
+              TEST: cpp
+              HXCPP_COMPILE_CACHE: ~/hxcache
+              APT_PACKAGES: gcc-multilib g++-multilib
+            java:
+              TEST: java,jvm
+            cs:
+              TEST: cs
+            js:
+              TEST: js
+              SAUCE: 1
+              SAUCE_TUNNEL_ID: $(Agent.JobName)
+              SAUCE_BUILD: $(Build.BuildNumber)
+            php:
+              TEST: php
+            flash:
+              TEST: flash9,as3
+              APT_PACKAGES: libglib2.0 libfreetype6 xvfb
+              DISPLAY: ':99.0'
+              AUDIODEV: 'null'
+            python:
+              TEST: python
+            lua:
+              TEST: lua
+        steps:
+          - script: |
+              set -ex
+              sudo add-apt-repository -y ppa:haxe/snapshots
+              sudo apt-get update -qqy
+              sudo apt-get install -qqy neko
+            displayName: Setup Neko
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'linuxBinaries'
+              targetPath: linuxBinaries
+          - script: |
+              set -ex
+              tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
+              sudo mkdir -p /usr/local/bin/
+              sudo mkdir -p /usr/local/share/haxe/
+              sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
+              sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
+              sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
+            displayName: Setup Haxe
+          - script: haxe -version
+            displayName: Print Haxe version
+          - script: |
+              set -ex
+              mkdir ~/haxelib
+              haxelib setup ~/haxelib
+            displayName: Setup haxelib
+          - script: |
+              set -ex
+              sudo apt update -qqy
+              sudo apt install -qqy $APT_PACKAGES
+            condition: and(succeeded(), variables['APT_PACKAGES'])
+            displayName: Install apt packages
+          - script: haxe RunCi.hxml
+            workingDirectory: $(Build.SourcesDirectory)/tests
+            env:
+              SAUCE_USERNAME: $(SAUCE_USERNAME)
+              SAUCE_ACCESS_KEY: $(SAUCE_ACCESS_KEY)
+            displayName: Test
+
+      - job: TestMac
+        dependsOn: BuildMac
+        pool:
+          vmImage: 'macOS-10.13'
+        strategy:
+          matrix:
+            macro:
+              TEST: macro
+            neko:
+              TEST: neko
+            hl:
+              TEST: hl
+              BREW_PACKAGES: ninja
+            cpp:
+              TEST: cpp
+              HXCPP_COMPILE_CACHE: ~/hxcache
+            java:
+              TEST: java,jvm
+            cs:
+              TEST: cs
+            js:
+              TEST: js
+            php:
+              TEST: php
+            flash:
+              TEST: flash9,as3
+            python:
+              TEST: python
+            lua:
+              TEST: lua
+        steps:
+          - script: |
+              set -ex
+              brew update
+              brew install neko --HEAD
+            displayName: Setup Neko
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'macBinaries'
+              targetPath: macBinaries
+          - script: |
+              set -ex
+              tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
+              sudo mkdir -p /usr/local/bin/
+              sudo mkdir -p /usr/local/share/haxe/
+              sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
+              sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
+              sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
+            displayName: Setup Haxe
+          - script: haxe -version
+            displayName: Print Haxe version
+          - script: |
+              set -ex
+              mkdir ~/haxelib
+              haxelib setup ~/haxelib
+            displayName: Setup haxelib
+          - script: brew install $BREW_PACKAGES
+            condition: and(succeeded(), variables['BREW_PACKAGES'])
+            displayName: Install homebrew packages
+          - script: haxe RunCi.hxml
+            workingDirectory: $(Build.SourcesDirectory)/tests
+            displayName: Test
+
+      - job: TestWindows64
+        dependsOn: BuildWindows
+        pool:
+          vmImage: 'windows-2019'
+        variables:
+          HAXELIB_ROOT: C:/haxelib
+          HAXE_ARCH: 64
+        strategy:
+          matrix:
+            macro:
+              TEST: macro
+            neko:
+              TEST: neko
+            hl:
+              TEST: hl
+            cpp:
+              TEST: cpp
+              HXCPP_COMPILE_CACHE: C:/hxcache
+            java:
+              TEST: java,jvm
+            cs:
+              TEST: cs
+            js:
+              TEST: js
+            # https://github.com/microsoft/azure-pipelines-image-generation/issues/990
+            # php:
+            #   TEST: php
+            # TODO. flash has never been enabled on our AppVeyor builds.
+            # flash:
+            #   TEST: flash9,as3
+            python:
+              TEST: python
+            # TODO. Lua has never been enabled on our AppVeyor builds.
+            # lua:
+            #   TEST: lua
+        steps:
+          - powershell: |
+              Set-PSDebug -Trace 1
+              choco install neko --prerelease --ignore-dependencies -s 'https://ci.appveyor.com/nuget/neko' -y
+              Set-PSDebug -Trace 0
+              Write-Host "##vso[task.setvariable variable=NEKOPATH]C:/ProgramData/chocolatey/lib/neko"
+            displayName: Setup Neko
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'win64Binaries'
+              targetPath: win64Binaries
+          - powershell: |
+              Set-PSDebug -Trace 1
+              7z x win64Binaries/*_bin.zip -owin64Binaries
+              $dir = Get-ChildItem win64Binaries/* -Name -Directory
+              Rename-Item win64Binaries/$dir haxe
+              $dir = '' + ( get-location ) + '\win64Binaries\haxe'
+              dir $dir
+              Set-PSDebug -Trace 0
+              Write-Host "##vso[task.prependpath]$dir"
+            displayName: Setup Haxe
+          - script: haxe -version
+            displayName: Print Haxe version
+          - task: UsePythonVersion@0
+            inputs:
+              versionSpec: '3.7'
+          - powershell: |
+              Set-PSDebug -Trace 1
+              $pypath = python -c "import sys; print(sys.executable)"
+              $py3path = $pypath.replace("python.exe","python3.exe")
+              cmd /c mklink $py3path $pypath
+              python3 -V
+            displayName: "Make Python 3 be available as python3 in the cmdline"
+          - script: |
+              mkdir "$(HAXELIB_ROOT)"
+              haxelib setup "$(HAXELIB_ROOT)"
+            displayName: Setup haxelib
+          - script: haxe RunCi.hxml
+            workingDirectory: $(Build.SourcesDirectory)/tests
+            displayName: Test
+  - stage: Deploy
+    condition: and(succeeded(), not(variables['System.PullRequest.PullRequestId']))
+    jobs:
+      - job: S3
+        condition: and(succeeded(), variables['AWS_ACCESS_KEY_ID'], variables['S3_HXBUILDS_ADDR'])
+        pool:
+          vmImage: 'ubuntu-16.04'
+        steps:
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'linuxBinaries'
+              targetPath: linuxBinaries
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'macBinaries'
+              targetPath: macBinaries
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'win64Binaries'
+              targetPath: win64Binaries
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'win32Binaries'
+              targetPath: win32Binaries
+          - script: |
+              set -ex
+              sudo add-apt-repository -y ppa:haxe/snapshots
+              sudo apt-get update -qqy
+              sudo apt-get install -qqy neko
+            displayName: Setup Neko
+          - script: |
+              set -ex
+              tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
+              sudo mkdir -p /usr/local/bin/
+              sudo mkdir -p /usr/local/share/haxe/
+              sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
+              sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
+              sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
+            displayName: Setup Haxe
+          - script: |
+              set -ex
+              sudo apt-get update -qqy
+              sudo apt-get install -qqy awscli
+            displayName: "Install awscli"
+          - script: |
+              set -ex
+              aws s3 cp linuxBinaries/*_bin.tar.gz      $(S3_HXBUILDS_ADDR)/linux64/             --dryrun
+              aws s3 cp macBinaries/*_bin.tar.gz        $(S3_HXBUILDS_ADDR)/mac/                 --dryrun
+              aws s3 cp win64Binaries/*_bin.zip         $(S3_HXBUILDS_ADDR)/windows64/           --dryrun
+              aws s3 cp win64Binaries/*_installer.zip   $(S3_HXBUILDS_ADDR)/windows64-installer/ --dryrun
+              aws s3 cp win32Binaries/*_bin.zip         $(S3_HXBUILDS_ADDR)/windows/             --dryrun
+              aws s3 cp win32Binaries/*_installer.zip   $(S3_HXBUILDS_ADDR)/windows-installer/   --dryrun
+            env:
+              AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
+            displayName: Upload binaries
+          - script: |
+              set -ex
+              aws s3 cp linuxBinaries/*_bin.tar.gz      $(S3_HXBUILDS_ADDR)/linux64/haxe_latest.tar.gz          --dryrun
+              aws s3 cp macBinaries/*_bin.tar.gz        $(S3_HXBUILDS_ADDR)/mac/haxe_latest.tar.gz              --dryrun
+              aws s3 cp win64Binaries/*_bin.zip         $(S3_HXBUILDS_ADDR)/windows64/haxe_latest.zip           --dryrun
+              aws s3 cp win64Binaries/*_installer.zip   $(S3_HXBUILDS_ADDR)/windows64-installer/haxe_latest.zip --dryrun
+              aws s3 cp win32Binaries/*_bin.zip         $(S3_HXBUILDS_ADDR)/windows/haxe_latest.zip             --dryrun
+              aws s3 cp win32Binaries/*_installer.zip   $(S3_HXBUILDS_ADDR)/windows-installer/haxe_latest.zip   --dryrun
+            env:
+              AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
+            condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'development'))
+            displayName: Update "latest"
+          - script: |
+              set -ex
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/linux64
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/linux64/              --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/mac
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/mac/                  --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/windows64
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/windows64/            --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/windows64-installer
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/windows64-installer/  --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/windows
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/windows/              --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)/windows-installer
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/windows-installer/    --dryrun
+              haxe --run runci.Indexer $(S3_HXBUILDS_ADDR)
+              aws s3 cp index.html     $(S3_HXBUILDS_ADDR)/                      --dryrun
+            workingDirectory: $(Build.SourcesDirectory)/tests
+            env:
+              AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
+            displayName: Update indices
+      - job: ApiHaxeOrg
+        condition: and(succeeded(), variables['GHP_USERNAME'], variables['GHP_EMAIL'])
+        pool:
+          vmImage: 'ubuntu-16.04'
+        steps:
+          - checkout: none
+          - script: |
+              set -ex
+              sudo add-apt-repository -y ppa:haxe/snapshots
+              sudo apt-get update -qqy
+              sudo apt-get install -qqy neko
+            displayName: Setup Neko
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'linuxBinaries'
+              targetPath: linuxBinaries
+          - script: |
+              set -ex
+              tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
+              sudo mkdir -p /usr/local/bin/
+              sudo mkdir -p /usr/local/share/haxe/
+              sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
+              sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
+              sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
+            displayName: Setup Haxe
+          - task: DownloadPipelineArtifact@0
+            inputs:
+              artifactName: 'xmldoc'
+              targetPath: xmldoc
+          - script: |
+              set -ex
+              LOCAL="`pwd`/extra/api.haxe.org"
+              git clone "${GHP_REMOTE}" "${LOCAL}"
+              haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"
+            env:
+              GHP_REMOTE: $(GHP_REMOTE)
+            displayName: Deploy to api.haxe.org

+ 2 - 1
tests/Brewfile

@@ -5,4 +5,5 @@ brew "ninja"
 brew "zlib"
 brew "zlib"
 brew "pcre"
 brew "pcre"
 brew "awscli"
 brew "awscli"
-brew "cmake"
+brew "cmake"
+brew "pkg-config"

+ 8 - 0
tests/RunCi.hx

@@ -39,6 +39,14 @@ class RunCi {
 					//pass
 					//pass
 			}
 			}
 
 
+			switch (systemName) {
+				case "Windows":
+					// change codepage to UTF-8
+					runCommand("chcp", ["65001"]);
+				case _:
+					//pass
+			}
+
 			infoMsg('test $test');
 			infoMsg('test $test');
 			var success = true;
 			var success = true;
 			try {
 			try {

+ 11 - 0
tests/runci/Config.hx

@@ -5,6 +5,7 @@ import sys.FileSystem;
 enum Ci {
 enum Ci {
 	TravisCI;
 	TravisCI;
 	AppVeyor;
 	AppVeyor;
+	AzurePipelines;
 }
 }
 
 
 class Config {
 class Config {
@@ -26,10 +27,20 @@ class Config {
 			TravisCI;
 			TravisCI;
 		else if (Sys.getEnv("APPVEYOR") == "True")
 		else if (Sys.getEnv("APPVEYOR") == "True")
 			AppVeyor;
 			AppVeyor;
+		else if (Sys.getEnv("TF_BUILD") == "True")
+			AzurePipelines;
 		else
 		else
 			null;
 			null;
 
 
 	static public function isCi():Bool {
 	static public function isCi():Bool {
 		return ci != null;
 		return ci != null;
 	}
 	}
+
+	static public final colorSupported = switch [ci, systemName] {
+		case [AzurePipelines, _]: true; // not sure
+		case [TravisCI | AppVeyor, _]: true;
+		case [_, "Linux" | "Mac"]: true;
+		case [_, "Windows"]: false;
+		case _: false;
+	}
 }
 }

+ 4 - 0
tests/runci/Deployment.hx

@@ -18,6 +18,8 @@ class Deployment {
 				Sys.getEnv("TRAVIS_REPO_SLUG");
 				Sys.getEnv("TRAVIS_REPO_SLUG");
 			case AppVeyor:
 			case AppVeyor:
 				Sys.getEnv("APPVEYOR_PROJECT_SLUG");
 				Sys.getEnv("APPVEYOR_PROJECT_SLUG");
+			case AzurePipelines:
+				Sys.getEnv("AZURE_PIPELINES_REPO_URL");
 			case _:
 			case _:
 				commandResult("git", ["config", "--get", "remote.origin.url"]).stdout.trim();
 				commandResult("git", ["config", "--get", "remote.origin.url"]).stdout.trim();
 		},
 		},
@@ -26,6 +28,8 @@ class Deployment {
 				Sys.getEnv("TRAVIS_BRANCH");
 				Sys.getEnv("TRAVIS_BRANCH");
 			case AppVeyor:
 			case AppVeyor:
 				Sys.getEnv("APPVEYOR_REPO_BRANCH");
 				Sys.getEnv("APPVEYOR_REPO_BRANCH");
+			case AzurePipelines:
+				Sys.getEnv("AZURE_PIPELINES_BRANCH");
 			case _:
 			case _:
 				commandResult("git", ["rev-parse", "--abbrev-ref", "HEAD"]).stdout.trim();
 				commandResult("git", ["rev-parse", "--abbrev-ref", "HEAD"]).stdout.trim();
 		},
 		},

+ 9 - 0
tests/runci/Indexer.hx

@@ -5,6 +5,15 @@ using StringTools;
 
 
 class Indexer
 class Indexer
 {
 {
+	static function main():Void {
+		switch (Sys.args()) {
+			case []:
+				throw "missing s3 path argument";
+			case [s3path]:
+				index(s3path);
+		}
+	}
+
 	public static function index(s3path:String)
 	public static function index(s3path:String)
 	{
 	{
 		var spaceRegex = ~/[ \t]+/g,
 		var spaceRegex = ~/[ \t]+/g,

+ 4 - 3
tests/runci/System.hx

@@ -15,13 +15,13 @@ class System {
 
 
 
 
 	static public function successMsg(msg:String):Void {
 	static public function successMsg(msg:String):Void {
-		Sys.println('\x1b[32m' + msg + '\x1b[0m');
+		Sys.println(colorSupported ? '\x1b[32m' + msg + '\x1b[0m' : msg);
 	}
 	}
 	static public function failMsg(msg:String):Void {
 	static public function failMsg(msg:String):Void {
-		Sys.println('\x1b[31m' + msg + '\x1b[0m');
+		Sys.println(colorSupported ? '\x1b[31m' + msg + '\x1b[0m' : msg);
 	}
 	}
 	static public function infoMsg(msg:String):Void {
 	static public function infoMsg(msg:String):Void {
-		Sys.println('\x1b[36m' + msg + '\x1b[0m');
+		Sys.println(colorSupported ? '\x1b[36m' + msg + '\x1b[0m' : msg);
 	}
 	}
 
 
 	static public function commandSucceed(cmd:String, args:Array<String>):Bool {
 	static public function commandSucceed(cmd:String, args:Array<String>):Bool {
@@ -102,6 +102,7 @@ class System {
 	}
 	}
 
 
 	static public function addToPATH(path:String):Void {
 	static public function addToPATH(path:String):Void {
+		infoMsg('Prepending $path to PATH.');
 		switch (systemName) {
 		switch (systemName) {
 			case "Windows":
 			case "Windows":
 				Sys.putEnv("PATH", path + ";" + Sys.getEnv("PATH"));
 				Sys.putEnv("PATH", path + ";" + Sys.getEnv("PATH"));

+ 7 - 5
tests/runci/targets/Cpp.hx

@@ -43,8 +43,8 @@ class Cpp {
 	static public function run(args:Array<String>, testCompiled:Bool, testCppia:Bool) {
 	static public function run(args:Array<String>, testCompiled:Bool, testCppia:Bool) {
 		getCppDependencies();
 		getCppDependencies();
 
 
-		switch (ci) {
-			case AppVeyor:
+		switch (systemName) {
+			case "Windows":
 				if (testCompiled) {
 				if (testCompiled) {
 					runCommand("haxe", ["compile-cpp.hxml", "-D", "HXCPP_M32"].concat(args));
 					runCommand("haxe", ["compile-cpp.hxml", "-D", "HXCPP_M32"].concat(args));
 					runCpp("bin/cpp/TestMain-debug", []);
 					runCpp("bin/cpp/TestMain-debug", []);
@@ -68,9 +68,11 @@ class Cpp {
 		runCommand("haxe", ["compile-cpp.hxml"]);
 		runCommand("haxe", ["compile-cpp.hxml"]);
 		runCpp("bin/cpp/Main-debug", []);
 		runCpp("bin/cpp/Main-debug", []);
 
 
-		changeDirectory(threadsDir);
-		runCommand("haxe", ["build.hxml", "-cpp", "export/cpp"]);
-		runCpp("export/cpp/Main");
+		if (systemName != "Windows") { // TODO: find out why we keep getting "missed async calls" error
+			changeDirectory(threadsDir);
+			runCommand("haxe", ["build.hxml", "-cpp", "export/cpp"]);
+			runCpp("export/cpp/Main");
+		}
 
 
 		// if (Sys.systemName() == "Mac")
 		// if (Sys.systemName() == "Mac")
 		// {
 		// {

+ 16 - 7
tests/runci/targets/Flash.hx

@@ -36,6 +36,8 @@ class Flash {
 		}
 		}
 	}
 	}
 
 
+	static public var playerCmd:String;
+
 	static public function setupFlashPlayerDebugger():Void {
 	static public function setupFlashPlayerDebugger():Void {
 		var mmcfgPath = switch (systemName) {
 		var mmcfgPath = switch (systemName) {
 			case "Linux":
 			case "Linux":
@@ -48,7 +50,7 @@ class Flash {
 
 
 		switch (systemName) {
 		switch (systemName) {
 			case "Linux":
 			case "Linux":
-				var playerCmd = "flashplayerdebugger";
+				playerCmd = "flashplayerdebugger";
 				if(Sys.command("type", [playerCmd]) != 0) {
 				if(Sys.command("type", [playerCmd]) != 0) {
 					Linux.requireAptPackages([
 					Linux.requireAptPackages([
 						"libglib2.0", "libfreetype6"
 						"libglib2.0", "libfreetype6"
@@ -56,16 +58,22 @@ class Flash {
 					var majorVersion = getLatestFPVersion()[0];
 					var majorVersion = getLatestFPVersion()[0];
 					runCommand("wget", ["-nv", 'http://fpdownload.macromedia.com/pub/flashplayer/updaters/${majorVersion}/flash_player_sa_linux_debug.x86_64.tar.gz'], true);
 					runCommand("wget", ["-nv", 'http://fpdownload.macromedia.com/pub/flashplayer/updaters/${majorVersion}/flash_player_sa_linux_debug.x86_64.tar.gz'], true);
 					runCommand("tar", ["-xf", "flash_player_sa_linux_debug.x86_64.tar.gz", "-C", Sys.getEnv("HOME")]);
 					runCommand("tar", ["-xf", "flash_player_sa_linux_debug.x86_64.tar.gz", "-C", Sys.getEnv("HOME")]);
-					playerCmd = Sys.getEnv("HOME") + "/flashplayerdebugger";
+					playerCmd = Path.join([Sys.getEnv("HOME"), "flashplayerdebugger"]);
 				}
 				}
 				if (!FileSystem.exists(mmcfgPath)) {
 				if (!FileSystem.exists(mmcfgPath)) {
 					File.saveContent(mmcfgPath, "ErrorReportingEnable=1\nTraceOutputFileEnable=1");
 					File.saveContent(mmcfgPath, "ErrorReportingEnable=1\nTraceOutputFileEnable=1");
 				}
 				}
-				runCommand(playerCmd, ["-v"]);
+				switch (ci) {
+					case AzurePipelines:
+						runCommand("xvfb-run", ["-a", playerCmd, "-v"]);
+					case _:
+						runCommand(playerCmd, ["-v"]);
+				}
 			case "Mac":
 			case "Mac":
 				if (commandResult("brew", ["cask", "list", "flash-player-debugger"]).exitCode == 0) {
 				if (commandResult("brew", ["cask", "list", "flash-player-debugger"]).exitCode == 0) {
 					return;
 					return;
 				}
 				}
+				runCommand("brew", ["update"]);
 				runCommand("brew", ["cask", "install", "flash-player-debugger"]);
 				runCommand("brew", ["cask", "install", "flash-player-debugger"]);
 
 
 				// Disable the "application downloaded from Internet" warning
 				// Disable the "application downloaded from Internet" warning
@@ -92,11 +100,12 @@ class Flash {
 		Sys.println('going to run $swf');
 		Sys.println('going to run $swf');
 		switch (systemName) {
 		switch (systemName) {
 			case "Linux":
 			case "Linux":
-				var playerCmd = "flashplayerdebugger";
-				if(Sys.command("type", [playerCmd]) != 0) {
-					playerCmd = Sys.getEnv("HOME") + "/flashplayerdebugger";
+				switch (ci) {
+					case AzurePipelines:
+						new Process("xvfb-run", ["-a", playerCmd, swf]);
+					case _:
+						new Process(playerCmd, [swf]);
 				}
 				}
-				new Process(playerCmd, [swf]);
 			case "Mac":
 			case "Mac":
 				Sys.command("open", ["-a", "/Applications/Flash Player Debugger.app", swf]);
 				Sys.command("open", ["-a", "/Applications/Flash Player Debugger.app", swf]);
 		}
 		}

+ 4 - 4
tests/runci/targets/Hl.hx

@@ -7,19 +7,19 @@ import runci.Config.*;
 
 
 class Hl {
 class Hl {
     static var hlSrc = switch [ci, systemName] {
     static var hlSrc = switch [ci, systemName] {
-      case [AppVeyor, "Windows"]: "C:\\hashlink";
+      case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink";
       case _: Path.join([Sys.getEnv("HOME"), "hashlink"]);
       case _: Path.join([Sys.getEnv("HOME"), "hashlink"]);
     };
     };
     static var hlBuild = switch [ci, systemName] {
     static var hlBuild = switch [ci, systemName] {
-      case [AppVeyor, "Windows"]: "C:\\hashlink_build";
+      case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build";
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build"]);
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build"]);
     };
     };
     static var hlBinDir = switch [ci, systemName] {
     static var hlBinDir = switch [ci, systemName] {
-      case [AppVeyor, "Windows"]: "C:\\hashlink_build\\bin";
+      case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build\\bin";
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin"]);
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin"]);
     };
     };
     static var hlBinary = switch [ci, systemName] {
     static var hlBinary = switch [ci, systemName] {
-      case [AppVeyor, "Windows"]: "C:\\hashlink_build\\bin\\hl";
+      case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build\\bin\\hl.exe";
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin", "hl"]);
       case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin", "hl"]);
     };
     };
 
 

+ 1 - 1
tests/runci/targets/Java.hx

@@ -28,7 +28,7 @@ class Java {
 
 
 		changeDirectory(threadsDir);
 		changeDirectory(threadsDir);
 		runCommand("haxe", ["build.hxml", "-java", "export/java"]);
 		runCommand("haxe", ["build.hxml", "-java", "export/java"]);
-		if (ci != AppVeyor) { // #8154
+		if (systemName != "Windows") { // #8154
 			runCommand("java", ["-jar", "export/java/Main.jar"]);
 			runCommand("java", ["-jar", "export/java/Main.jar"]);
 		}
 		}
 
 

+ 29 - 19
tests/runci/targets/Js.hx

@@ -10,14 +10,17 @@ using StringTools;
 
 
 class Js {
 class Js {
 	static public function getJSDependencies() {
 	static public function getJSDependencies() {
-		switch (systemName) {
-			case "Linux":
+		switch [ci, systemName] {
+			case [_, "Linux"]:
 				if (commandSucceed("node", ["-v"])) {
 				if (commandSucceed("node", ["-v"])) {
 					infoMsg('node has already been installed.');
 					infoMsg('node has already been installed.');
 				} else {
 				} else {
 					Linux.requireAptPackages(["nodejs"]);
 					Linux.requireAptPackages(["nodejs"]);
 				}
 				}
-			case "Mac":
+			case [AzurePipelines, "Mac"]:
+				runCommand("brew", ["install", "node@10"], true);
+				runCommand("brew", ["link", "--overwrite", "--force", "node@10"]);
+			case _:
 				//pass
 				//pass
 		}
 		}
 
 
@@ -64,21 +67,26 @@ class Js {
 			env.exists("SAUCE_USERNAME") &&
 			env.exists("SAUCE_USERNAME") &&
 			env.exists("SAUCE_ACCESS_KEY")
 			env.exists("SAUCE_ACCESS_KEY")
 		) {
 		) {
-			// sauce-connect should have been started
-
-			// var scVersion = "sc-4.3-linux";
-			// runCommand("wget", ['https://saucelabs.com/downloads/${scVersion}.tar.gz'], true);
-			// runCommand("tar", ["-xf", '${scVersion}.tar.gz']);
-
-			// //start sauce-connect
-			// var scReadyFile = "sauce-connect-ready-" + Std.random(100);
-			// var sc = new Process('${scVersion}/bin/sc', [
-			// 	"-i", Sys.getEnv("TRAVIS_JOB_NUMBER"),
-			// 	"-f", scReadyFile
-			// ]);
-			// while(!FileSystem.exists(scReadyFile)) {
-			// 	Sys.sleep(0.5);
-			// }
+			var sc = switch (ci) {
+				case AzurePipelines:
+					var scVersion = "sc-4.5.3-linux";
+					runCommand("wget", ["-q", 'https://saucelabs.com/downloads/${scVersion}.tar.gz'], true);
+					runCommand("tar", ["-xf", '${scVersion}.tar.gz']);
+
+					//start sauce-connect
+					var scReadyFile = "sauce-connect-ready-" + Std.random(100);
+					var p = new Process('${scVersion}/bin/sc', [
+						"-i", Sys.getEnv("SAUCE_TUNNEL_ID"),
+						"-f", scReadyFile
+					]);
+					while(!FileSystem.exists(scReadyFile)) {
+						Sys.sleep(0.5);
+					}
+					p;
+				case _:
+					// sauce-connect should have been started
+					null;
+			}
 
 
 			changeDirectory(unitDir);
 			changeDirectory(unitDir);
 			runCommand("npm", ["install", "wd", "q"], true);
 			runCommand("npm", ["install", "wd", "q"], true);
@@ -87,7 +95,9 @@ class Js {
 			runCommand("node", ["bin/RunSauceLabs.js"].concat([for (js in jsOutputs) "unit-js.html?js=" + js.urlEncode()]));
 			runCommand("node", ["bin/RunSauceLabs.js"].concat([for (js in jsOutputs) "unit-js.html?js=" + js.urlEncode()]));
 
 
 			server.close();
 			server.close();
-			// sc.close();
+
+			if (sc != null)
+				sc.close();
 		}
 		}
 
 
 		infoMsg("Test optimization:");
 		infoMsg("Test optimization:");

+ 1 - 1
tests/runci/targets/Jvm.hx

@@ -17,7 +17,7 @@ class Jvm {
 
 
 		changeDirectory(threadsDir);
 		changeDirectory(threadsDir);
 		runCommand("haxe", ["build.hxml", "-java", "export/jvm", "-D", "jvm"]);
 		runCommand("haxe", ["build.hxml", "-java", "export/jvm", "-D", "jvm"]);
-		if (ci != AppVeyor) { // #8154
+		if (systemName != "Windows") { // #8154
 			runCommand("java", ["-jar", "export/jvm/Main.jar"]);
 			runCommand("java", ["-jar", "export/jvm/Main.jar"]);
 		}
 		}
 	}
 	}

+ 4 - 1
tests/runci/targets/Lua.hx

@@ -3,14 +3,17 @@ package runci.targets;
 import sys.FileSystem;
 import sys.FileSystem;
 import runci.System.*;
 import runci.System.*;
 import runci.Config.*;
 import runci.Config.*;
+import haxe.io.*;
 using StringTools;
 using StringTools;
 
 
 class Lua {
 class Lua {
 	static public function getLuaDependencies(){
 	static public function getLuaDependencies(){
 		switch (systemName){
 		switch (systemName){
 			case "Linux":
 			case "Linux":
-				Linux.requireAptPackages(["libpcre3-dev"]);
+				Linux.requireAptPackages(["libpcre3-dev", "libssl-dev", "libreadline-dev"]);
 				runCommand("pip", ["install", "--user", "hererocks"]);
 				runCommand("pip", ["install", "--user", "hererocks"]);
+				var pyUserBase = commandResult("python", ["-m", "site", "--user-base"]).stdout.trim();
+				addToPATH(Path.join([pyUserBase, "bin"]));
 			case "Mac": {
 			case "Mac": {
 				if (commandSucceed("python3", ["-V"]))
 				if (commandSucceed("python3", ["-V"]))
 					infoMsg('python3 has already been installed.');
 					infoMsg('python3 has already been installed.');

+ 9 - 5
tests/runci/targets/Php.hx

@@ -20,13 +20,17 @@ class Php {
 			infoMsg('php ${phpVer} has already been installed.');
 			infoMsg('php ${phpVer} has already been installed.');
 			return;
 			return;
 		}
 		}
-		switch (systemName) {
-			case "Linux":
+		switch [ci, systemName] {
+			case [TravisCI, "Linux"]:
 				runCommand("phpenv", ["global", "7.0"], false, true);
 				runCommand("phpenv", ["global", "7.0"], false, true);
-			case "Mac":
+			case [_, "Linux"]:
+				Linux.requireAptPackages(["php-cli", "php-mbstring"]);
+			case [_, "Mac"]:
 				runCommand("brew", ["install", "php"], true);
 				runCommand("brew", ["install", "php"], true);
-			case "Windows":
+			case [_, "Windows"]:
 				runCommand("cinst", ["php", "-version", "7.1.8", "-y"], true);
 				runCommand("cinst", ["php", "-version", "7.1.8", "-y"], true);
+			case _:
+				throw 'unknown combination: $ci, $systemName';
 		}
 		}
 		runCommand("php", ["-v"]);
 		runCommand("php", ["-v"]);
 	}
 	}
@@ -64,7 +68,7 @@ class Php {
 	}
 	}
 
 
 	static function runThroughPhpVersions(fn:()->Void) {
 	static function runThroughPhpVersions(fn:()->Void) {
-	if(isCi() && systemName == "Linux") {
+		if(ci == TravisCI && systemName == "Linux") {
 			for(version in ['7.0', '7.1'/*, '7.2', '7.3'*/]) { //7.2 and 7.3 are not available on travis Ubuntu trusty
 			for(version in ['7.0', '7.1'/*, '7.2', '7.3'*/]) { //7.2 and 7.3 are not available on travis Ubuntu trusty
 				runCommand("phpenv", ["global", version]);
 				runCommand("phpenv", ["global", version]);
 				fn();
 				fn();

+ 14 - 0
tests/unit/src/RunSauceLabs.hx

@@ -138,6 +138,8 @@ class RunSauceLabs {
 		var tags = [];
 		var tags = [];
 		if (Sys.getEnv("TRAVIS") != null)
 		if (Sys.getEnv("TRAVIS") != null)
 			tags.push("TravisCI");
 			tags.push("TravisCI");
+		if (Sys.getEnv("TF_BUILD") != null)
+			tags.push("AzurePipelines");
 
 
 		var maxDuration = 60 * 5; //5 min
 		var maxDuration = 60 * 5; //5 min
 		var commandTimeout = 60;  //60s
 		var commandTimeout = 60;  //60s
@@ -156,6 +158,18 @@ class RunSauceLabs {
 				caps.setField("tunnel-identifier", Sys.getEnv("TRAVIS_JOB_NUMBER"));
 				caps.setField("tunnel-identifier", Sys.getEnv("TRAVIS_JOB_NUMBER"));
 				caps.setField("build", Sys.getEnv("TRAVIS_BUILD_NUMBER"));
 				caps.setField("build", Sys.getEnv("TRAVIS_BUILD_NUMBER"));
 			}
 			}
+			switch (Sys.getEnv("SAUCE_TUNNEL_ID")) {
+				case null:
+					//pass
+				case id:
+					caps.setField("tunnel-identifier", id);
+			}
+			switch (Sys.getEnv("SAUCE_BUILD")) {
+				case null:
+					//pass
+				case build:
+					caps.setField("build", build);
+			}
 
 
 			trials--;
 			trials--;