From 727a6411e0fafdf8688212e7e7d39c85aaddc3ed Mon Sep 17 00:00:00 2001 From: RblSb Date: Sat, 21 Mar 2020 07:54:59 +0300 Subject: [PATCH 1/6] Github actions --- .github/workflows/main.yml | 890 ++++++++++++++++++++++++ extra/github-actions/Main.hx | 48 ++ extra/github-actions/build-linux.yml | 45 ++ extra/github-actions/build-mac.yml | 33 + extra/github-actions/build-windows.yml | 50 ++ extra/github-actions/build.hxml | 2 + extra/github-actions/install-neko.yml | 53 ++ extra/github-actions/test-linux.yml | 46 ++ extra/github-actions/test-mac.yml | 33 + extra/github-actions/test-windows.yml | 41 ++ extra/github-actions/workflows/main.yml | 179 +++++ tests/RunCi.hx | 2 + tests/runci/Config.hx | 6 +- tests/runci/targets/Flash.hx | 6 +- 14 files changed, 1430 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 extra/github-actions/Main.hx create mode 100644 extra/github-actions/build-linux.yml create mode 100644 extra/github-actions/build-mac.yml create mode 100644 extra/github-actions/build-windows.yml create mode 100644 extra/github-actions/build.hxml create mode 100644 extra/github-actions/install-neko.yml create mode 100644 extra/github-actions/test-linux.yml create mode 100644 extra/github-actions/test-mac.yml create mode 100644 extra/github-actions/test-windows.yml create mode 100644 extra/github-actions/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..3f98e2d43b7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,890 @@ +# DO NOT EDIT. Generated from /extra/github-actions +name: CI +on: [push, pull_request] + +jobs: + windows64-build: + runs-on: windows-latest + # if: false + env: + PLATFORM: windows64 + OPAMYES: 1 + CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ + ARCH: 64 + MINGW_ARCH: x86_64 + CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe + CYG_ROOT: C:/cygwin64 + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + - name: choco install nsis + shell: pwsh + run: choco install --no-progress nsis.portable --version 3.02 -y + - name: choco install things + shell: pwsh + run: choco install --no-progress curl wget 7zip.portable -y + - name: Prepend Chocolatey path + shell: pwsh + run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin" + + - name: Install OCaml and OCaml libraries + shell: pwsh + run: | + Set-PSDebug -Trace 1 + curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP) + Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env: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 mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env: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$($env:ARCH).tar.xz + curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh') + & "$($env: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') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') + + - name: Expose mingw dll files + shell: pwsh + run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin" + + - name: Build Haxe + shell: pwsh + run: | + Set-PSDebug -Trace 1 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1') + & "$($env: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 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') + + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: win${{env.ARCH}}Binaries + path: out + + + windows-build: + runs-on: windows-latest + # if: false + env: + PLATFORM: windows + OPAMYES: 1 + CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ + ARCH: 32 + MINGW_ARCH: i686 + CYGWIN_SETUP: https://cygwin.com/setup-x86.exe + CYG_ROOT: C:/cygwin + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + - name: choco install nsis + shell: pwsh + run: choco install --no-progress nsis.portable --version 3.02 -y + - name: choco install things + shell: pwsh + run: choco install --no-progress curl wget 7zip.portable -y + - name: Prepend Chocolatey path + shell: pwsh + run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin" + + - name: Install OCaml and OCaml libraries + shell: pwsh + run: | + Set-PSDebug -Trace 1 + curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP) + Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env: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 mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env: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$($env:ARCH).tar.xz + curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh') + & "$($env: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') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') + + - name: Expose mingw dll files + shell: pwsh + run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin" + + - name: Build Haxe + shell: pwsh + run: | + Set-PSDebug -Trace 1 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1') + & "$($env: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 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') + + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: win${{env.ARCH}}Binaries + path: out + + + linux-build: + runs-on: ubuntu-latest + # if: false + env: + PLATFORM: linux64 + OPAMYES: 1 + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + - name: Install dependencies + run: | + set -ex + sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2 + sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls + sudo apt-get update -qqy + sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build neko neko-dev + + - name: Install OCaml libraries + run: | + set -ex + opam init # --disable-sandboxing + opam update + opam pin add haxe . --no-action + opam install haxe --deps-only + opam list + ocamlopt -v + + - name: Build Haxe + run: | + set -ex + eval $(opam env) + opam config exec -- make -s -j`nproc` STATICLINK=1 haxe + opam config exec -- make -s haxelib + make -s package_unix + ls -l out + ldd -v ./haxe + ldd -v ./haxelib + + - name: Build xmldoc + run: | + set -ex + make -s xmldoc + cat >extra/doc/info.json <&1 + + + - name: Install dependencies + run: | + set -ex + brew update || brew update || brew update + brew unlink python@2 + brew bundle --file=tests/Brewfile --no-upgrade + + - name: Install OCaml libraries + run: | + set -ex + opam init # --disable-sandboxing + opam update + opam pin add haxe . --no-action + opam install haxe --deps-only + opam list + ocamlopt -v + + - name: Build Haxe + run: | + set -ex + eval $(opam env) + 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 /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe + opam config exec -- make -s haxelib + make -s package_unix + ls -l out + otool -L ./haxe + otool -L ./haxelib + + - name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: macBinaries + path: out + + + windows64-test: + needs: windows64-build + runs-on: windows-latest + env: + PLATFORM: windows64 + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + ARCH: 64 + strategy: + fail-fast: false + matrix: + # TODO. Lua/flash has never been enabled on our AppVeyor builds. + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: win${{env.ARCH}}Binaries + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + # - name: Quick test + # shell: pwsh + # run: | + # $DOWNLOADDIR="./win$($env:ARCH)Binaries" + # new-item -Name $DOWNLOADDIR -ItemType directory + # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip + + - name: Setup Haxe + shell: pwsh + run: | + $DOWNLOADDIR="./win$($env:ARCH)Binaries" + Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR + Set-PSDebug -Trace 1 + $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory + Write-Host "::add-path::$HAXEPATH" + Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib" + + - name: Print Haxe version + shell: pwsh + run: haxe -version + + - name: "Make Python 3 be available as python3 in the cmdline" + shell: pwsh + run: | + 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 + + - name: Setup haxelib + shell: pwsh + run: | + mkdir "$env:HAXELIB_ROOT" + haxelib setup "$env:HAXELIB_ROOT" + + - name: Test + shell: pwsh + run: | + haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + + + windows-test: + needs: windows-build + runs-on: windows-latest + # if: false + env: + PLATFORM: windows + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + ARCH: 32 + strategy: + fail-fast: false + matrix: + # TODO. Lua/flash has never been enabled on our AppVeyor builds. + # jvm: https://github.com/HaxeFoundation/haxe/issues/8601 + target: [macro, js, hl, cpp, java, cs, php, python, neko] + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: win${{env.ARCH}}Binaries + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + # - name: Quick test + # shell: pwsh + # run: | + # $DOWNLOADDIR="./win$($env:ARCH)Binaries" + # new-item -Name $DOWNLOADDIR -ItemType directory + # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip + + - name: Setup Haxe + shell: pwsh + run: | + $DOWNLOADDIR="./win$($env:ARCH)Binaries" + Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR + Set-PSDebug -Trace 1 + $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory + Write-Host "::add-path::$HAXEPATH" + Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib" + + - name: Print Haxe version + shell: pwsh + run: haxe -version + + - name: "Make Python 3 be available as python3 in the cmdline" + shell: pwsh + run: | + 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 + + - name: Setup haxelib + shell: pwsh + run: | + mkdir "$env:HAXELIB_ROOT" + haxelib setup "$env:HAXELIB_ROOT" + + - name: Test + shell: pwsh + run: | + haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + + + linux-test: + needs: linux-build + runs-on: ubuntu-latest + env: + PLATFORM: linux64 + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + strategy: + fail-fast: false + matrix: + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko] + include: + - target: js + # SAUCE: 1 + # SAUCE_TUNNEL_ID: 'linux-test' + # SAUCE_BUILD: '${{env.GITHUB_RUN_NUMBER}}' # $(Build.BuildNumber) + - target: hl + APT_PACKAGES: cmake ninja-build libturbojpeg-dev + - target: cpp + APT_PACKAGES: gcc-multilib g++-multilib + - target: lua + APT_PACKAGES: ncurses-dev + - target: flash9 + APT_PACKAGES: libglib2.0 libfreetype6 xvfb + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: linuxBinaries + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + - name: Setup Haxe + run: | + # mkdir ./linuxBinaries + # curl -sSL https://build.haxe.org/builds/haxe/linux64/haxe_latest.tar.gz -o ./linuxBinaries/haxe_bin.tar.gz + + sudo apt install -qqy libmbedtls-dev + + 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 + + - name: Print Haxe version + run: haxe -version + + - name: Setup haxelib + run: | + set -ex + mkdir ~/haxelib + haxelib setup ~/haxelib + + - name: Install apt packages + if: matrix.APT_PACKAGES + run: | + set -ex + sudo apt update -qqy + sudo apt install -qqy ${{matrix.APT_PACKAGES}} + + - name: Flash setup + if: matrix.target == 'flash9' + run: export DISPLAY=:99.0 + + - name: Test + if: success() && !(matrix.SAUCE && matrix.SAUCE_ACCESS_KEY) + run: haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + + - name: Test (with SauceLabs) + if: matrix.target == 'js' && success() && matrix.SAUCE && matrix.SAUCE_ACCESS_KEY + run: haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + env: + SAUCE_ACCESS_KEY: matrix.SAUCE_ACCESS_KEY + + + mac-test: + needs: mac-build + runs-on: macos-latest + # if: false + env: + PLATFORM: mac + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + strategy: + fail-fast: false + matrix: + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko] + include: + - target: hl + BREW_PACKAGES: ninja + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: macBinaries + + - name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + + - name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + + - name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + + - name: Print Neko version + run: neko -version 2>&1 + + + - name: Setup Haxe + run: | + # mkdir ./macBinaries + # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz + + 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 + + - name: Print Haxe version + run: haxe -version + + - name: Setup haxelib + run: | + set -ex + mkdir ~/haxelib + haxelib setup ~/haxelib + + - name: Install homebrew packages + if: matrix.BREW_PACKAGES + run: brew install ${{matrix.BREW_PACKAGES}} + + - name: Test + run: | + # LC_CTYPE=C + # LANG=C + haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + + diff --git a/extra/github-actions/Main.hx b/extra/github-actions/Main.hx new file mode 100644 index 00000000000..0e4648413cc --- /dev/null +++ b/extra/github-actions/Main.hx @@ -0,0 +1,48 @@ +package; + +import sys.FileSystem; +import sys.io.File; +import haxe.io.Path; +using StringTools; + +class Main { + + static final matchImport = ~/^([ \t]*)@import (.+)$/gm; + static final matchRunnable = ~/^([ \t]*)jobs:/gm; + + static function main():Void new Main(); + + function new() { + final folder = FileSystem.absolutePath("."); + final outFolder = "../../.github"; + + iterFolderItems(folder, (dir, name) -> { + final ext = Path.extension(name); + if (ext != "yaml" && ext != "yml") return; + + final data = File.getContent('$dir/$name'); + var newData = matchImport.map(data, reg -> { + final spaces = reg.matched(1); + final path = reg.matched(2); + final template = File.getContent('./$path'); + final lines = template.split("\n"); + for (i in 0...lines.length) lines[i] = spaces + lines[i]; + lines.join("\n"); + }); + + if (!matchRunnable.match(newData)) return; + final first = "# DO NOT EDIT. Generated from /extra/github-actions\n"; + newData = first + newData; + final relativeDir = dir.replace(folder, ""); + File.saveContent('$outFolder$relativeDir/$name', newData); + }); + } + + function iterFolderItems(dir:String, func:(dir:String, name:String)->Void):Void { + for (name in FileSystem.readDirectory(dir)) { + if (FileSystem.isDirectory(name)) iterFolderItems('$dir/$name', func); + func(dir, name); + } + } + +} diff --git a/extra/github-actions/build-linux.yml b/extra/github-actions/build-linux.yml new file mode 100644 index 00000000000..cd26cf42847 --- /dev/null +++ b/extra/github-actions/build-linux.yml @@ -0,0 +1,45 @@ +- name: Install dependencies + run: | + set -ex + sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2 + sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls + sudo apt-get update -qqy + sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build neko neko-dev + +- name: Install OCaml libraries + run: | + set -ex + opam init # --disable-sandboxing + opam update + opam pin add haxe . --no-action + opam install haxe --deps-only + opam list + ocamlopt -v + +- name: Build Haxe + run: | + set -ex + eval $(opam env) + opam config exec -- make -s -j`nproc` STATICLINK=1 haxe + opam config exec -- make -s haxelib + make -s package_unix + ls -l out + ldd -v ./haxe + ldd -v ./haxelib + +- name: Build xmldoc + run: | + set -ex + make -s xmldoc + cat >extra/doc/info.json <&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') + +- name: Expose mingw dll files + shell: pwsh + run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin" + +- name: Build Haxe + shell: pwsh + run: | + Set-PSDebug -Trace 1 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1') + & "$($env: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 + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') + +- name: Upload artifact + uses: actions/upload-artifact@v1.0.0 + with: + name: win${{env.ARCH}}Binaries + path: out diff --git a/extra/github-actions/build.hxml b/extra/github-actions/build.hxml new file mode 100644 index 00000000000..e2a3d27a190 --- /dev/null +++ b/extra/github-actions/build.hxml @@ -0,0 +1,2 @@ +--main Main +--interp diff --git a/extra/github-actions/install-neko.yml b/extra/github-actions/install-neko.yml new file mode 100644 index 00000000000..d797db6acb8 --- /dev/null +++ b/extra/github-actions/install-neko.yml @@ -0,0 +1,53 @@ +- name: Install Neko using snapshot from S3 (Windows) + if: startsWith(env.PLATFORM, 'windows') + shell: pwsh + run: | + $DOWNLOADDIR="./temp" + new-item -Name $DOWNLOADDIR -ItemType directory + Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip + Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR + $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* + Write-Host "::add-path::$NEKOPATH" + Write-Host "::set-env name=NEKOPATH::$NEKOPATH" + +- name: Install Neko using snapshot from S3 (Unix) + # if: (!startsWith(env.PLATFORM, 'windows')) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + + # DOWNLOADDIR="./temp" + # mkdir $DOWNLOADDIR + # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz + # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR + # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` + # sudo mkdir -p /usr/local/bin + # sudo mkdir -p /usr/local/lib/neko + # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ + # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ + # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ + # set +x + # echo "::add-path::$NEKOPATH" + # echo "::set-env name=NEKOPATH::$NEKOPATH" + +- name: Install Neko using snapshot from S3 (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + +- name: ldconfig + if: env.PLATFORM == 'linux64' + run: | + sudo ldconfig + sudo ldconfig /usr/local/lib + +- name: Print Neko version + run: neko -version 2>&1 + diff --git a/extra/github-actions/test-linux.yml b/extra/github-actions/test-linux.yml new file mode 100644 index 00000000000..e42e7b47dc3 --- /dev/null +++ b/extra/github-actions/test-linux.yml @@ -0,0 +1,46 @@ +- name: Setup Haxe + run: | + # mkdir ./linuxBinaries + # curl -sSL https://build.haxe.org/builds/haxe/linux64/haxe_latest.tar.gz -o ./linuxBinaries/haxe_bin.tar.gz + + sudo apt install -qqy libmbedtls-dev + + 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 + +- name: Print Haxe version + run: haxe -version + +- name: Setup haxelib + run: | + set -ex + mkdir ~/haxelib + haxelib setup ~/haxelib + +- name: Install apt packages + if: matrix.APT_PACKAGES + run: | + set -ex + sudo apt update -qqy + sudo apt install -qqy ${{matrix.APT_PACKAGES}} + +- name: Flash setup + if: matrix.target == 'flash9' + run: export DISPLAY=:99.0 + +- name: Test + if: success() && !(matrix.SAUCE && matrix.SAUCE_ACCESS_KEY) + run: haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + +- name: Test (with SauceLabs) + if: matrix.target == 'js' && success() && matrix.SAUCE && matrix.SAUCE_ACCESS_KEY + run: haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + env: + SAUCE_ACCESS_KEY: matrix.SAUCE_ACCESS_KEY diff --git a/extra/github-actions/test-mac.yml b/extra/github-actions/test-mac.yml new file mode 100644 index 00000000000..fccadb6ac1c --- /dev/null +++ b/extra/github-actions/test-mac.yml @@ -0,0 +1,33 @@ +- name: Setup Haxe + run: | + # mkdir ./macBinaries + # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz + + 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 + +- name: Print Haxe version + run: haxe -version + +- name: Setup haxelib + run: | + set -ex + mkdir ~/haxelib + haxelib setup ~/haxelib + +- name: Install homebrew packages + if: matrix.BREW_PACKAGES + run: brew install ${{matrix.BREW_PACKAGES}} + +- name: Test + run: | + # LC_CTYPE=C + # LANG=C + haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests + diff --git a/extra/github-actions/test-windows.yml b/extra/github-actions/test-windows.yml new file mode 100644 index 00000000000..6b3b250055e --- /dev/null +++ b/extra/github-actions/test-windows.yml @@ -0,0 +1,41 @@ +# - name: Quick test +# shell: pwsh +# run: | +# $DOWNLOADDIR="./win$($env:ARCH)Binaries" +# new-item -Name $DOWNLOADDIR -ItemType directory +# Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip + +- name: Setup Haxe + shell: pwsh + run: | + $DOWNLOADDIR="./win$($env:ARCH)Binaries" + Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR + Set-PSDebug -Trace 1 + $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory + Write-Host "::add-path::$HAXEPATH" + Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib" + +- name: Print Haxe version + shell: pwsh + run: haxe -version + +- name: "Make Python 3 be available as python3 in the cmdline" + shell: pwsh + run: | + 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 + +- name: Setup haxelib + shell: pwsh + run: | + mkdir "$env:HAXELIB_ROOT" + haxelib setup "$env:HAXELIB_ROOT" + +- name: Test + shell: pwsh + run: | + haxe RunCi.hxml + working-directory: ${{github.workspace}}/tests diff --git a/extra/github-actions/workflows/main.yml b/extra/github-actions/workflows/main.yml new file mode 100644 index 00000000000..45212e11de2 --- /dev/null +++ b/extra/github-actions/workflows/main.yml @@ -0,0 +1,179 @@ +name: CI +on: [push, pull_request] + +jobs: + windows64-build: + runs-on: windows-latest + # if: false + env: + PLATFORM: windows64 + OPAMYES: 1 + CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ + ARCH: 64 + MINGW_ARCH: x86_64 + CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe + CYG_ROOT: C:/cygwin64 + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + @import install-neko.yml + @import build-windows.yml + + windows-build: + runs-on: windows-latest + # if: false + env: + PLATFORM: windows + OPAMYES: 1 + CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ + ARCH: 32 + MINGW_ARCH: i686 + CYGWIN_SETUP: https://cygwin.com/setup-x86.exe + CYG_ROOT: C:/cygwin + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + @import install-neko.yml + @import build-windows.yml + + linux-build: + runs-on: ubuntu-latest + # if: false + env: + PLATFORM: linux64 + OPAMYES: 1 + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + @import build-linux.yml + + mac-build: + runs-on: macos-latest + # if: false + env: + PLATFORM: mac + OPAMYES: 1 + steps: + - uses: actions/checkout@master + with: + submodules: recursive + + @import install-neko.yml + @import build-mac.yml + + windows64-test: + needs: windows64-build + runs-on: windows-latest + env: + PLATFORM: windows64 + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + ARCH: 64 + strategy: + fail-fast: false + matrix: + # TODO. Lua/flash has never been enabled on our AppVeyor builds. + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: win${{env.ARCH}}Binaries + + @import install-neko.yml + @import test-windows.yml + + windows-test: + needs: windows-build + runs-on: windows-latest + # if: false + env: + PLATFORM: windows + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + ARCH: 32 + strategy: + fail-fast: false + matrix: + # TODO. Lua/flash has never been enabled on our AppVeyor builds. + # jvm: https://github.com/HaxeFoundation/haxe/issues/8601 + target: [macro, js, hl, cpp, java, cs, php, python, neko] + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: win${{env.ARCH}}Binaries + + @import install-neko.yml + @import test-windows.yml + + linux-test: + needs: linux-build + runs-on: ubuntu-latest + env: + PLATFORM: linux64 + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + strategy: + fail-fast: false + matrix: + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko] + include: + - target: js + # SAUCE: 1 + # SAUCE_TUNNEL_ID: 'linux-test' + # SAUCE_BUILD: '${{env.GITHUB_RUN_NUMBER}}' # $(Build.BuildNumber) + - target: hl + APT_PACKAGES: cmake ninja-build libturbojpeg-dev + - target: cpp + APT_PACKAGES: gcc-multilib g++-multilib + - target: lua + APT_PACKAGES: ncurses-dev + - target: flash9 + APT_PACKAGES: libglib2.0 libfreetype6 xvfb + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: linuxBinaries + + @import install-neko.yml + @import test-linux.yml + + mac-test: + needs: mac-build + runs-on: macos-latest + # if: false + env: + PLATFORM: mac + TEST: ${{matrix.target}} + HXCPP_COMPILE_CACHE: ~/hxcache + strategy: + fail-fast: false + matrix: + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko] + include: + - target: hl + BREW_PACKAGES: ninja + steps: + - uses: actions/checkout@master + with: + submodules: recursive + - uses: actions/download-artifact@v1 + with: + name: macBinaries + + @import install-neko.yml + @import test-mac.yml diff --git a/tests/RunCi.hx b/tests/RunCi.hx index d8ae8fd5e0b..cfb7cc9cbd8 100644 --- a/tests/RunCi.hx +++ b/tests/RunCi.hx @@ -72,6 +72,8 @@ class RunCi { ["-D","appveyor"]; case AzurePipelines: ["-D","azure"]; + case GithubActions: + ["-D","github"]; } args = args.concat(["-D", systemName]); switch (test) { diff --git a/tests/runci/Config.hx b/tests/runci/Config.hx index f0a32067747..c617edbf362 100644 --- a/tests/runci/Config.hx +++ b/tests/runci/Config.hx @@ -6,6 +6,7 @@ enum Ci { TravisCI; AppVeyor; AzurePipelines; + GithubActions; } class Config { @@ -29,6 +30,8 @@ class Config { AppVeyor; else if (Sys.getEnv("TF_BUILD") == "True") AzurePipelines; + else if (Sys.getEnv("GITHUB_WORKSPACE") != null) + GithubActions; else null; @@ -38,9 +41,10 @@ class Config { static public final colorSupported = switch [ci, systemName] { case [AzurePipelines, _]: true; // not sure + case [GithubActions, _]: true; case [TravisCI | AppVeyor, _]: true; case [_, "Linux" | "Mac"]: true; case [_, "Windows"]: false; case _: false; } -} \ No newline at end of file +} diff --git a/tests/runci/targets/Flash.hx b/tests/runci/targets/Flash.hx index 55dfc73ff33..f881ee9c4ec 100644 --- a/tests/runci/targets/Flash.hx +++ b/tests/runci/targets/Flash.hx @@ -64,7 +64,7 @@ class Flash { File.saveContent(mmcfgPath, "ErrorReportingEnable=1\nTraceOutputFileEnable=1"); } switch (ci) { - case AzurePipelines: + case AzurePipelines, GithubActions: runCommand("xvfb-run", ["-a", playerCmd, "-v"]); case _: runCommand(playerCmd, ["-v"]); @@ -101,7 +101,7 @@ class Flash { switch (systemName) { case "Linux": switch (ci) { - case AzurePipelines: + case AzurePipelines, GithubActions: new Process("xvfb-run", ["-a", playerCmd, swf]); case _: new Process(playerCmd, [swf]); @@ -166,4 +166,4 @@ class Flash { } -} \ No newline at end of file +} From 0a180f8c2130c8c8b699b2b2f786444816efd839 Mon Sep 17 00:00:00 2001 From: RblSb Date: Sat, 21 Mar 2020 20:34:55 +0300 Subject: [PATCH 2/6] Clean up --- .github/workflows/main.yml | 204 +++--------------------- extra/github-actions/Main.hx | 6 +- extra/github-actions/build-mac.yml | 2 +- extra/github-actions/install-neko.yml | 23 --- extra/github-actions/test-mac.yml | 5 +- extra/github-actions/test-windows.yml | 11 +- extra/github-actions/workflows/main.yml | 14 +- tests/runci/targets/Flash.hx | 4 +- 8 files changed, 43 insertions(+), 226 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f98e2d43b7..571ad0d21b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,6 @@ on: [push, pull_request] jobs: windows64-build: runs-on: windows-latest - # if: false env: PLATFORM: windows64 OPAMYES: 1 @@ -32,7 +31,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -40,22 +38,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -63,12 +45,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -127,7 +103,6 @@ jobs: windows-build: runs-on: windows-latest - # if: false env: PLATFORM: windows OPAMYES: 1 @@ -154,7 +129,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -162,22 +136,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -185,12 +143,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -249,7 +201,6 @@ jobs: linux-build: runs-on: ubuntu-latest - # if: false env: PLATFORM: linux64 OPAMYES: 1 @@ -307,7 +258,6 @@ jobs: mac-build: runs-on: macos-latest - # if: false env: PLATFORM: mac OPAMYES: 1 @@ -329,7 +279,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -337,22 +286,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -360,12 +293,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -373,7 +300,7 @@ jobs: - name: Install dependencies run: | set -ex - brew update || brew update || brew update + brew update brew unlink python@2 brew bundle --file=tests/Brewfile --no-upgrade @@ -416,8 +343,7 @@ jobs: strategy: fail-fast: false matrix: - # TODO. Lua/flash has never been enabled on our AppVeyor builds. - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, neko] steps: - uses: actions/checkout@master with: @@ -439,7 +365,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -447,22 +372,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -470,12 +379,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -510,6 +413,14 @@ jobs: cmd /c mklink $py3path $pypath python3 -V + - name: Install hererocks + if: matrix.target == 'lua' + shell: cmd + run: | + pip install hererocks + hererocks lua53 -l5.3 -rlatest + call lua53/bin/activate + - name: Setup haxelib shell: pwsh run: | @@ -518,15 +429,13 @@ jobs: - name: Test shell: pwsh - run: | - haxe RunCi.hxml + run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests windows-test: needs: windows-build runs-on: windows-latest - # if: false env: PLATFORM: windows TEST: ${{matrix.target}} @@ -535,9 +444,8 @@ jobs: strategy: fail-fast: false matrix: - # TODO. Lua/flash has never been enabled on our AppVeyor builds. - # jvm: https://github.com/HaxeFoundation/haxe/issues/8601 - target: [macro, js, hl, cpp, java, cs, php, python, neko] + # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601 + target: [macro, js, hl, cpp, java, cs, php, python, lua, neko] steps: - uses: actions/checkout@master with: @@ -559,7 +467,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -567,22 +474,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -590,12 +481,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -630,6 +515,14 @@ jobs: cmd /c mklink $py3path $pypath python3 -V + - name: Install hererocks + if: matrix.target == 'lua' + shell: cmd + run: | + pip install hererocks + hererocks lua53 -l5.3 -rlatest + call lua53/bin/activate + - name: Setup haxelib shell: pwsh run: | @@ -638,8 +531,7 @@ jobs: - name: Test shell: pwsh - run: | - haxe RunCi.hxml + run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests @@ -688,7 +580,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -696,22 +587,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -719,12 +594,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -780,7 +649,6 @@ jobs: mac-test: needs: mac-build runs-on: macos-latest - # if: false env: PLATFORM: mac TEST: ${{matrix.target}} @@ -813,7 +681,6 @@ jobs: Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -821,22 +688,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -844,12 +695,6 @@ jobs: HOMEBREW_NO_AUTO_UPDATE=1 brew install neko - - name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 @@ -882,9 +727,8 @@ jobs: - name: Test run: | - # LC_CTYPE=C - # LANG=C + # disable invalid Unicode filenames on APFS + echo "" > sys/compile-fs.hxml haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - diff --git a/extra/github-actions/Main.hx b/extra/github-actions/Main.hx index 0e4648413cc..35c2d0b5799 100644 --- a/extra/github-actions/Main.hx +++ b/extra/github-actions/Main.hx @@ -10,9 +10,7 @@ class Main { static final matchImport = ~/^([ \t]*)@import (.+)$/gm; static final matchRunnable = ~/^([ \t]*)jobs:/gm; - static function main():Void new Main(); - - function new() { + static function main():Void { final folder = FileSystem.absolutePath("."); final outFolder = "../../.github"; @@ -38,7 +36,7 @@ class Main { }); } - function iterFolderItems(dir:String, func:(dir:String, name:String)->Void):Void { + static function iterFolderItems(dir:String, func:(dir:String, name:String)->Void):Void { for (name in FileSystem.readDirectory(dir)) { if (FileSystem.isDirectory(name)) iterFolderItems('$dir/$name', func); func(dir, name); diff --git a/extra/github-actions/build-mac.yml b/extra/github-actions/build-mac.yml index af28ed75a39..6603af5f552 100644 --- a/extra/github-actions/build-mac.yml +++ b/extra/github-actions/build-mac.yml @@ -1,7 +1,7 @@ - name: Install dependencies run: | set -ex - brew update || brew update || brew update + brew update brew unlink python@2 brew bundle --file=tests/Brewfile --no-upgrade diff --git a/extra/github-actions/install-neko.yml b/extra/github-actions/install-neko.yml index d797db6acb8..36446aaba78 100644 --- a/extra/github-actions/install-neko.yml +++ b/extra/github-actions/install-neko.yml @@ -11,7 +11,6 @@ Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - name: Install Neko using snapshot from S3 (Unix) - # if: (!startsWith(env.PLATFORM, 'windows')) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -19,22 +18,6 @@ sudo apt-get update -qqy sudo apt-get install -qqy neko - # DOWNLOADDIR="./temp" - # mkdir $DOWNLOADDIR - # curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $DOWNLOADDIR/neko_latest.tar.gz - # tar -xf $DOWNLOADDIR/neko_latest.tar.gz -C $DOWNLOADDIR - # NEKOPATH=`echo $DOWNLOADDIR/neko-*-*` - # sudo mkdir -p /usr/local/bin - # sudo mkdir -p /usr/local/lib/neko - # sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - # sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - # sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/nekoml.std /usr/local/lib/neko/ - # sudo ln -s $NEKOPATH/include/*.h /usr/local/include/ - # set +x - # echo "::add-path::$NEKOPATH" - # echo "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | @@ -42,12 +25,6 @@ HOMEBREW_NO_AUTO_UPDATE=1 brew install neko -- name: ldconfig - if: env.PLATFORM == 'linux64' - run: | - sudo ldconfig - sudo ldconfig /usr/local/lib - - name: Print Neko version run: neko -version 2>&1 diff --git a/extra/github-actions/test-mac.yml b/extra/github-actions/test-mac.yml index fccadb6ac1c..19cfce156aa 100644 --- a/extra/github-actions/test-mac.yml +++ b/extra/github-actions/test-mac.yml @@ -26,8 +26,7 @@ - name: Test run: | - # LC_CTYPE=C - # LANG=C + # disable invalid Unicode filenames on APFS + echo "" > sys/compile-fs.hxml haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - diff --git a/extra/github-actions/test-windows.yml b/extra/github-actions/test-windows.yml index 6b3b250055e..2056ab9d744 100644 --- a/extra/github-actions/test-windows.yml +++ b/extra/github-actions/test-windows.yml @@ -28,6 +28,14 @@ cmd /c mklink $py3path $pypath python3 -V +- name: Install hererocks + if: matrix.target == 'lua' + shell: cmd + run: | + pip install hererocks + hererocks lua53 -l5.3 -rlatest + call lua53/bin/activate + - name: Setup haxelib shell: pwsh run: | @@ -36,6 +44,5 @@ - name: Test shell: pwsh - run: | - haxe RunCi.hxml + run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests diff --git a/extra/github-actions/workflows/main.yml b/extra/github-actions/workflows/main.yml index 45212e11de2..b7604389167 100644 --- a/extra/github-actions/workflows/main.yml +++ b/extra/github-actions/workflows/main.yml @@ -4,7 +4,6 @@ on: [push, pull_request] jobs: windows64-build: runs-on: windows-latest - # if: false env: PLATFORM: windows64 OPAMYES: 1 @@ -23,7 +22,6 @@ jobs: windows-build: runs-on: windows-latest - # if: false env: PLATFORM: windows OPAMYES: 1 @@ -42,7 +40,6 @@ jobs: linux-build: runs-on: ubuntu-latest - # if: false env: PLATFORM: linux64 OPAMYES: 1 @@ -55,7 +52,6 @@ jobs: mac-build: runs-on: macos-latest - # if: false env: PLATFORM: mac OPAMYES: 1 @@ -78,8 +74,7 @@ jobs: strategy: fail-fast: false matrix: - # TODO. Lua/flash has never been enabled on our AppVeyor builds. - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, neko] steps: - uses: actions/checkout@master with: @@ -94,7 +89,6 @@ jobs: windows-test: needs: windows-build runs-on: windows-latest - # if: false env: PLATFORM: windows TEST: ${{matrix.target}} @@ -103,9 +97,8 @@ jobs: strategy: fail-fast: false matrix: - # TODO. Lua/flash has never been enabled on our AppVeyor builds. - # jvm: https://github.com/HaxeFoundation/haxe/issues/8601 - target: [macro, js, hl, cpp, java, cs, php, python, neko] + # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601 + target: [macro, js, hl, cpp, java, cs, php, python, lua, neko] steps: - uses: actions/checkout@master with: @@ -155,7 +148,6 @@ jobs: mac-test: needs: mac-build runs-on: macos-latest - # if: false env: PLATFORM: mac TEST: ${{matrix.target}} diff --git a/tests/runci/targets/Flash.hx b/tests/runci/targets/Flash.hx index f881ee9c4ec..4031aa34682 100644 --- a/tests/runci/targets/Flash.hx +++ b/tests/runci/targets/Flash.hx @@ -64,7 +64,7 @@ class Flash { File.saveContent(mmcfgPath, "ErrorReportingEnable=1\nTraceOutputFileEnable=1"); } switch (ci) { - case AzurePipelines, GithubActions: + case AzurePipelines | GithubActions: runCommand("xvfb-run", ["-a", playerCmd, "-v"]); case _: runCommand(playerCmd, ["-v"]); @@ -101,7 +101,7 @@ class Flash { switch (systemName) { case "Linux": switch (ci) { - case AzurePipelines, GithubActions: + case AzurePipelines | GithubActions: new Process("xvfb-run", ["-a", playerCmd, swf]); case _: new Process(playerCmd, [swf]); From 8d0c92aa7e9d801f1963ccd3dcfac850396f551a Mon Sep 17 00:00:00 2001 From: RblSb Date: Thu, 14 May 2020 04:48:38 +0300 Subject: [PATCH 3/6] Split neko installation to platform files --- .github/workflows/main.yml | 125 +----------------- extra/github-actions/install-neko-linux.yml | 11 ++ extra/github-actions/install-neko-mac.yml | 10 ++ ...tall-neko.yml => install-neko-windows.yml} | 15 --- extra/github-actions/workflows/main.yml | 14 +- 5 files changed, 31 insertions(+), 144 deletions(-) create mode 100644 extra/github-actions/install-neko-linux.yml create mode 100644 extra/github-actions/install-neko-mac.yml rename extra/github-actions/{install-neko.yml => install-neko-windows.yml} (60%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 571ad0d21b9..a5c8cc95e34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,21 +30,6 @@ jobs: Write-Host "::add-path::$NEKOPATH" Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 @@ -128,21 +113,6 @@ jobs: Write-Host "::add-path::$NEKOPATH" Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 @@ -266,27 +236,7 @@ jobs: with: submodules: recursive - - name: Install Neko using snapshot from S3 (Windows) - if: startsWith(env.PLATFORM, 'windows') - shell: pwsh - run: | - $DOWNLOADDIR="./temp" - new-item -Name $DOWNLOADDIR -ItemType directory - Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip - Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR - $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* - Write-Host "::add-path::$NEKOPATH" - Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) + - name: Install Neko using homebrew (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | set -ex @@ -364,21 +314,6 @@ jobs: Write-Host "::add-path::$NEKOPATH" Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 @@ -466,21 +401,6 @@ jobs: Write-Host "::add-path::$NEKOPATH" Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 @@ -567,19 +487,7 @@ jobs: with: name: linuxBinaries - - name: Install Neko using snapshot from S3 (Windows) - if: startsWith(env.PLATFORM, 'windows') - shell: pwsh - run: | - $DOWNLOADDIR="./temp" - new-item -Name $DOWNLOADDIR -ItemType directory - Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip - Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR - $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* - Write-Host "::add-path::$NEKOPATH" - Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - - name: Install Neko using snapshot from S3 (Unix) + - name: Install Neko using apt-get (Linux) if: (startsWith(env.PLATFORM, 'linux')) run: | set -ex @@ -587,13 +495,6 @@ jobs: sudo apt-get update -qqy sudo apt-get install -qqy neko - - name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 @@ -668,27 +569,7 @@ jobs: with: name: macBinaries - - name: Install Neko using snapshot from S3 (Windows) - if: startsWith(env.PLATFORM, 'windows') - shell: pwsh - run: | - $DOWNLOADDIR="./temp" - new-item -Name $DOWNLOADDIR -ItemType directory - Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip - Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR - $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-* - Write-Host "::add-path::$NEKOPATH" - Write-Host "::set-env name=NEKOPATH::$NEKOPATH" - - - name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - - - name: Install Neko using snapshot from S3 (Mac) + - name: Install Neko using homebrew (Mac) if: (startsWith(env.PLATFORM, 'mac')) run: | set -ex diff --git a/extra/github-actions/install-neko-linux.yml b/extra/github-actions/install-neko-linux.yml new file mode 100644 index 00000000000..1108b6f09ec --- /dev/null +++ b/extra/github-actions/install-neko-linux.yml @@ -0,0 +1,11 @@ +- name: Install Neko using apt-get (Linux) + if: (startsWith(env.PLATFORM, 'linux')) + run: | + set -ex + sudo add-apt-repository ppa:haxe/snapshots -y + sudo apt-get update -qqy + sudo apt-get install -qqy neko + +- name: Print Neko version + run: neko -version 2>&1 + diff --git a/extra/github-actions/install-neko-mac.yml b/extra/github-actions/install-neko-mac.yml new file mode 100644 index 00000000000..f0945070eaf --- /dev/null +++ b/extra/github-actions/install-neko-mac.yml @@ -0,0 +1,10 @@ +- name: Install Neko using homebrew (Mac) + if: (startsWith(env.PLATFORM, 'mac')) + run: | + set -ex + HOMEBREW_NO_AUTO_UPDATE=1 + brew install neko + +- name: Print Neko version + run: neko -version 2>&1 + diff --git a/extra/github-actions/install-neko.yml b/extra/github-actions/install-neko-windows.yml similarity index 60% rename from extra/github-actions/install-neko.yml rename to extra/github-actions/install-neko-windows.yml index 36446aaba78..a81789533d6 100644 --- a/extra/github-actions/install-neko.yml +++ b/extra/github-actions/install-neko-windows.yml @@ -10,21 +10,6 @@ Write-Host "::add-path::$NEKOPATH" Write-Host "::set-env name=NEKOPATH::$NEKOPATH" -- name: Install Neko using snapshot from S3 (Unix) - if: (startsWith(env.PLATFORM, 'linux')) - run: | - set -ex - sudo add-apt-repository ppa:haxe/snapshots -y - sudo apt-get update -qqy - sudo apt-get install -qqy neko - -- name: Install Neko using snapshot from S3 (Mac) - if: (startsWith(env.PLATFORM, 'mac')) - run: | - set -ex - HOMEBREW_NO_AUTO_UPDATE=1 - brew install neko - - name: Print Neko version run: neko -version 2>&1 diff --git a/extra/github-actions/workflows/main.yml b/extra/github-actions/workflows/main.yml index b7604389167..7544329fd86 100644 --- a/extra/github-actions/workflows/main.yml +++ b/extra/github-actions/workflows/main.yml @@ -17,7 +17,7 @@ jobs: with: submodules: recursive - @import install-neko.yml + @import install-neko-windows.yml @import build-windows.yml windows-build: @@ -35,7 +35,7 @@ jobs: with: submodules: recursive - @import install-neko.yml + @import install-neko-windows.yml @import build-windows.yml linux-build: @@ -60,7 +60,7 @@ jobs: with: submodules: recursive - @import install-neko.yml + @import install-neko-mac.yml @import build-mac.yml windows64-test: @@ -83,7 +83,7 @@ jobs: with: name: win${{env.ARCH}}Binaries - @import install-neko.yml + @import install-neko-windows.yml @import test-windows.yml windows-test: @@ -107,7 +107,7 @@ jobs: with: name: win${{env.ARCH}}Binaries - @import install-neko.yml + @import install-neko-windows.yml @import test-windows.yml linux-test: @@ -142,7 +142,7 @@ jobs: with: name: linuxBinaries - @import install-neko.yml + @import install-neko-linux.yml @import test-linux.yml mac-test: @@ -167,5 +167,5 @@ jobs: with: name: macBinaries - @import install-neko.yml + @import install-neko-mac.yml @import test-mac.yml From 54682cb1487cfa88c4f14e1abaed294028ba8804 Mon Sep 17 00:00:00 2001 From: RblSb Date: Fri, 15 May 2020 11:17:48 +0300 Subject: [PATCH 4/6] Fix hl best test is disabled test --- tests/sys/src/TestUnicode.hx | 2 +- tests/unit/src/unit/TestHttp.hx | 6 +++--- tests/unit/src/unit/TestMain.hx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/src/TestUnicode.hx b/tests/sys/src/TestUnicode.hx index 00ed2829efd..add1bc58bc0 100644 --- a/tests/sys/src/TestUnicode.hx +++ b/tests/sys/src/TestUnicode.hx @@ -295,7 +295,7 @@ class TestUnicode extends utest.Test { } // Temporary disabled for local run because of https://github.com/HaxeFoundation/haxe/issues/8380 - #if (travis || appveyor || azure) + #if (travis || appveyor || azure || github) function testIPC() { // stdin.readLine UnicodeSequences.normalBoth(str -> { diff --git a/tests/unit/src/unit/TestHttp.hx b/tests/unit/src/unit/TestHttp.hx index ef80d7fd923..a8198f02f2b 100644 --- a/tests/unit/src/unit/TestHttp.hx +++ b/tests/unit/src/unit/TestHttp.hx @@ -13,7 +13,7 @@ class TestHttp extends Test { function run(async:Async, test:()->Void) { // { comment this out to run http tests locally - #if (!azure || (azure && js && !nodejs)) //also don't run on sauce labs + #if (!(azure || github) || ((azure || github) && js && !nodejs)) //also don't run on sauce labs noAssert(); async.done(); return; @@ -27,7 +27,7 @@ class TestHttp extends Test { return; } test(); - #elseif (azure && (hl || java || (flash && (Linux || Mac)) || (cs && Windows))) + #elseif ((azure || github) && (hl || java || (flash && (Linux || Mac)) || (cs && Windows))) noAssert(); async.done(); return; @@ -35,7 +35,7 @@ class TestHttp extends Test { test(); #end } -#if !(azure && hl) +#if !((azure || github) && hl) @:timeout(1000) public function testPostData(async:Async) run(async, () -> { var srcStr = 'hello, world'; diff --git a/tests/unit/src/unit/TestMain.hx b/tests/unit/src/unit/TestMain.hx index 8d1eaa86ece..14eb182e756 100644 --- a/tests/unit/src/unit/TestMain.hx +++ b/tests/unit/src/unit/TestMain.hx @@ -74,7 +74,7 @@ class TestMain { new TestNull(), new TestNumericCasts(), new TestHashMap(), - #if (!no_http && (!azure || !(php && Windows))) + #if (!no_http && (!(azure || github) || !(php && Windows))) new TestHttp(), #end #if !no_pattern_matching From a50fb75107e185e1e32781961d389fe449e626b1 Mon Sep 17 00:00:00 2001 From: RblSb Date: Fri, 15 May 2020 14:55:17 +0300 Subject: [PATCH 5/6] Windows hl fix --- tests/runci/targets/Hl.hx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/runci/targets/Hl.hx b/tests/runci/targets/Hl.hx index 3436d31c514..8d8c20f92c0 100644 --- a/tests/runci/targets/Hl.hx +++ b/tests/runci/targets/Hl.hx @@ -7,19 +7,19 @@ import runci.Config.*; class Hl { static var hlSrc = switch [ci, systemName] { - case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink"; + case [AppVeyor | AzurePipelines | GithubActions, "Windows"]: "C:\\hashlink"; case _: Path.join([Sys.getEnv("HOME"), "hashlink"]); }; static var hlBuild = switch [ci, systemName] { - case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build"; + case [AppVeyor | AzurePipelines | GithubActions, "Windows"]: "C:\\hashlink_build"; case _: Path.join([Sys.getEnv("HOME"), "hashlink_build"]); }; static var hlBinDir = switch [ci, systemName] { - case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build\\bin"; + case [AppVeyor | AzurePipelines | GithubActions, "Windows"]: "C:\\hashlink_build\\bin"; case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin"]); }; static var hlBinary = switch [ci, systemName] { - case [AppVeyor | AzurePipelines, "Windows"]: "C:\\hashlink_build\\bin\\hl.exe"; + case [AppVeyor | AzurePipelines | GithubActions, "Windows"]: "C:\\hashlink_build\\bin\\hl.exe"; case _: Path.join([Sys.getEnv("HOME"), "hashlink_build", "bin", "hl"]); }; @@ -28,7 +28,9 @@ class Hl { infoMsg('hl has already been installed.'); return; } - runCommand("git", ["clone", "https://github.com/HaxeFoundation/hashlink.git", hlSrc]); + if (!FileSystem.exists(hlSrc)) { + runCommand("git", ["clone", "https://github.com/HaxeFoundation/hashlink.git", hlSrc]); + } else infoMsg("Reusing hashlink repository"); switch (systemName) { case "Linux": @@ -77,4 +79,4 @@ class Hl { runCommand("haxe", ["compile-hl.hxml"].concat(args)); runCommand(hlBinary, ["bin/hl/sys.hl"]); } -} \ No newline at end of file +} From a344a25a4a9ee1946d17beb1e78ae8b5e1fc2b72 Mon Sep 17 00:00:00 2001 From: RblSb Date: Fri, 15 May 2020 15:20:20 +0300 Subject: [PATCH 6/6] Disable lua for windows --- .github/workflows/main.yml | 6 ++++-- extra/github-actions/workflows/main.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5c8cc95e34..07235145102 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -293,7 +293,8 @@ jobs: strategy: fail-fast: false matrix: - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, neko] + # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024 + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] steps: - uses: actions/checkout@master with: @@ -380,7 +381,8 @@ jobs: fail-fast: false matrix: # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601 - target: [macro, js, hl, cpp, java, cs, php, python, lua, neko] + # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024 + target: [macro, js, hl, cpp, java, cs, php, python, neko] steps: - uses: actions/checkout@master with: diff --git a/extra/github-actions/workflows/main.yml b/extra/github-actions/workflows/main.yml index 7544329fd86..b721928a8f5 100644 --- a/extra/github-actions/workflows/main.yml +++ b/extra/github-actions/workflows/main.yml @@ -74,7 +74,8 @@ jobs: strategy: fail-fast: false matrix: - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, neko] + # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024 + target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko] steps: - uses: actions/checkout@master with: @@ -98,7 +99,8 @@ jobs: fail-fast: false matrix: # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601 - target: [macro, js, hl, cpp, java, cs, php, python, lua, neko] + # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024 + target: [macro, js, hl, cpp, java, cs, php, python, neko] steps: - uses: actions/checkout@master with: