main.yml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. # DO NOT EDIT. Generated from /extra/github-actions
  2. # TODO: support skip ci (https://github.community/t/github-actions-does-not-respect-skip-ci/17325/8)
  3. name: CI
  4. on: [push, pull_request]
  5. jobs:
  6. cancel:
  7. name: "Cancel previous runs"
  8. runs-on: ubuntu-latest
  9. timeout-minutes: 3
  10. steps:
  11. - uses: styfle/[email protected]
  12. with:
  13. workflow_id: 1447568
  14. access_token: ${{ github.token }}
  15. windows64-build:
  16. runs-on: windows-latest
  17. env:
  18. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  19. PLATFORM: windows64
  20. OPAMYES: 1
  21. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  22. ARCH: 64
  23. MINGW_ARCH: x86_64
  24. CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe
  25. CYG_ROOT: C:/cygwin64
  26. steps:
  27. - uses: actions/checkout@main
  28. with:
  29. submodules: recursive
  30. - name: Install Neko using snapshot from S3 (Windows)
  31. if: startsWith(env.PLATFORM, 'windows')
  32. shell: pwsh
  33. run: |
  34. $DOWNLOADDIR="./temp"
  35. new-item -Name $DOWNLOADDIR -ItemType directory
  36. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  37. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  38. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  39. Write-Host "::add-path::$NEKOPATH"
  40. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  41. - name: Print Neko version
  42. run: neko -version 2>&1
  43. - name: choco install nsis
  44. uses: nick-invision/retry@v1
  45. with:
  46. timeout_minutes: 10
  47. max_attempts: 10
  48. command: choco install --no-progress nsis.portable --version 3.02 -y
  49. - name: choco install things
  50. shell: pwsh
  51. run: choco install --no-progress curl wget 7zip.portable -y
  52. - name: Prepend Chocolatey path
  53. shell: pwsh
  54. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  55. - name: Install OCaml and OCaml libraries
  56. shell: pwsh
  57. run: |
  58. Set-PSDebug -Trace 1
  59. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  60. 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
  61. 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
  62. 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
  63. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  64. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  65. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  66. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  67. & "$($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')
  68. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  69. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  70. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  71. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#somaxconn --yes 2>&1')
  72. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  73. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  74. - name: Expose mingw dll files
  75. shell: pwsh
  76. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  77. - name: Build Haxe
  78. shell: pwsh
  79. run: |
  80. Set-PSDebug -Trace 1
  81. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  82. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  83. & "$($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')
  84. dir out
  85. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  86. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  87. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  88. - name: Upload artifact
  89. uses: actions/[email protected]
  90. with:
  91. name: win${{env.ARCH}}Binaries
  92. path: out
  93. windows-build:
  94. runs-on: windows-latest
  95. env:
  96. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  97. PLATFORM: windows
  98. OPAMYES: 1
  99. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  100. ARCH: 32
  101. MINGW_ARCH: i686
  102. CYGWIN_SETUP: https://cygwin.com/setup-x86.exe
  103. CYG_ROOT: C:/cygwin
  104. steps:
  105. - uses: actions/checkout@main
  106. with:
  107. submodules: recursive
  108. - name: Install Neko using snapshot from S3 (Windows)
  109. if: startsWith(env.PLATFORM, 'windows')
  110. shell: pwsh
  111. run: |
  112. $DOWNLOADDIR="./temp"
  113. new-item -Name $DOWNLOADDIR -ItemType directory
  114. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  115. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  116. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  117. Write-Host "::add-path::$NEKOPATH"
  118. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  119. - name: Print Neko version
  120. run: neko -version 2>&1
  121. - name: choco install nsis
  122. uses: nick-invision/retry@v1
  123. with:
  124. timeout_minutes: 10
  125. max_attempts: 10
  126. command: choco install --no-progress nsis.portable --version 3.02 -y
  127. - name: choco install things
  128. shell: pwsh
  129. run: choco install --no-progress curl wget 7zip.portable -y
  130. - name: Prepend Chocolatey path
  131. shell: pwsh
  132. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  133. - name: Install OCaml and OCaml libraries
  134. shell: pwsh
  135. run: |
  136. Set-PSDebug -Trace 1
  137. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  138. 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
  139. 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
  140. 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
  141. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  142. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  143. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  144. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  145. & "$($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')
  146. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  147. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  148. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  149. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#somaxconn --yes 2>&1')
  150. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  151. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  152. - name: Expose mingw dll files
  153. shell: pwsh
  154. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  155. - name: Build Haxe
  156. shell: pwsh
  157. run: |
  158. Set-PSDebug -Trace 1
  159. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  160. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  161. & "$($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')
  162. dir out
  163. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  164. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  165. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  166. - name: Upload artifact
  167. uses: actions/[email protected]
  168. with:
  169. name: win${{env.ARCH}}Binaries
  170. path: out
  171. linux-build:
  172. runs-on: ubuntu-latest
  173. env:
  174. PLATFORM: linux64
  175. OPAMYES: 1
  176. steps:
  177. - uses: actions/checkout@main
  178. with:
  179. submodules: recursive
  180. - name: Install dependencies
  181. run: |
  182. set -ex
  183. sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2
  184. sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls
  185. sudo apt-get update -qqy
  186. sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build neko neko-dev
  187. - name: Install OCaml libraries
  188. run: |
  189. set -ex
  190. opam init # --disable-sandboxing
  191. opam update
  192. opam pin add haxe . --no-action
  193. opam install haxe --deps-only
  194. opam list
  195. ocamlopt -v
  196. - name: Build Haxe
  197. run: |
  198. set -ex
  199. eval $(opam env)
  200. opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
  201. opam config exec -- make -s haxelib
  202. make -s package_unix
  203. ls -l out
  204. ldd -v ./haxe
  205. ldd -v ./haxelib
  206. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  207. - name: Extract branch name
  208. id: extract_branch
  209. shell: bash
  210. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  211. - name: Build xmldoc
  212. run: |
  213. set -ex
  214. make -s xmldoc
  215. cat >extra/doc/info.json <<EOL
  216. {
  217. "commit": "$GITHUB_SHA",
  218. "branch": "${{ steps.extract_branch.outputs.branch }}"
  219. }
  220. EOL
  221. - name: Upload xmldoc artifact
  222. uses: actions/[email protected]
  223. with:
  224. name: xmldoc
  225. path: extra/doc
  226. - name: Upload artifact
  227. uses: actions/[email protected]
  228. with:
  229. name: linuxBinaries
  230. path: out
  231. mac-build:
  232. runs-on: macos-latest
  233. env:
  234. PLATFORM: mac
  235. OPAMYES: 1
  236. steps:
  237. - uses: actions/checkout@main
  238. with:
  239. submodules: recursive
  240. - name: Install Neko using homebrew (Mac)
  241. if: (startsWith(env.PLATFORM, 'mac'))
  242. run: |
  243. set -ex
  244. HOMEBREW_NO_AUTO_UPDATE=1
  245. brew install neko
  246. - name: Print Neko version
  247. run: neko -version 2>&1
  248. - name: Install dependencies
  249. run: |
  250. set -ex
  251. brew uninstall [email protected]
  252. brew uninstall [email protected]
  253. brew untap local/openssl
  254. brew untap local/python2
  255. brew update
  256. # brew unlink python@2
  257. brew bundle --file=tests/Brewfile --no-upgrade || brew link --overwrite awscli
  258. - name: Install OCaml libraries
  259. run: |
  260. set -ex
  261. opam init # --disable-sandboxing
  262. opam update
  263. opam pin add haxe . --no-action
  264. opam install haxe --deps-only
  265. opam list
  266. ocamlopt -v
  267. - name: Build Haxe
  268. run: |
  269. set -ex
  270. eval $(opam env)
  271. 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
  272. opam config exec -- make -s haxelib
  273. make -s package_unix package_installer_mac
  274. ls -l out
  275. otool -L ./haxe
  276. otool -L ./haxelib
  277. - name: Upload artifact
  278. uses: actions/[email protected]
  279. with:
  280. name: macBinaries
  281. path: out
  282. windows64-test:
  283. needs: windows64-build
  284. runs-on: windows-latest
  285. env:
  286. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  287. PLATFORM: windows64
  288. TEST: ${{matrix.target}}
  289. HXCPP_COMPILE_CACHE: ~/hxcache
  290. ARCH: 64
  291. strategy:
  292. fail-fast: false
  293. matrix:
  294. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024
  295. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko]
  296. steps:
  297. - uses: actions/checkout@main
  298. with:
  299. submodules: recursive
  300. - uses: actions/download-artifact@v1
  301. with:
  302. name: win${{env.ARCH}}Binaries
  303. - name: Install Neko using snapshot from S3 (Windows)
  304. if: startsWith(env.PLATFORM, 'windows')
  305. shell: pwsh
  306. run: |
  307. $DOWNLOADDIR="./temp"
  308. new-item -Name $DOWNLOADDIR -ItemType directory
  309. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  310. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  311. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  312. Write-Host "::add-path::$NEKOPATH"
  313. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  314. - name: Print Neko version
  315. run: neko -version 2>&1
  316. # - name: Quick test
  317. # shell: pwsh
  318. # run: |
  319. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  320. # new-item -Name $DOWNLOADDIR -ItemType directory
  321. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  322. - name: Setup Haxe
  323. shell: pwsh
  324. run: |
  325. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  326. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  327. Set-PSDebug -Trace 1
  328. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  329. Write-Host "::add-path::$HAXEPATH"
  330. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  331. - name: Print Haxe version
  332. shell: pwsh
  333. run: haxe -version
  334. - name: "Make Python 3 be available as python3 in the cmdline"
  335. shell: pwsh
  336. run: |
  337. Set-PSDebug -Trace 1
  338. $pypath = python -c "import sys; print(sys.executable)"
  339. $py3path = $pypath.replace("python.exe","python3.exe")
  340. cmd /c mklink $py3path $pypath
  341. python3 -V
  342. - name: Install hererocks
  343. if: matrix.target == 'lua'
  344. shell: cmd
  345. run: |
  346. pip install hererocks
  347. hererocks lua53 -l5.3 -rlatest
  348. call lua53/bin/activate
  349. - name: Setup haxelib
  350. shell: pwsh
  351. run: |
  352. mkdir "$env:HAXELIB_ROOT"
  353. haxelib setup "$env:HAXELIB_ROOT"
  354. - name: Test
  355. shell: pwsh
  356. run: haxe RunCi.hxml
  357. working-directory: ${{github.workspace}}/tests
  358. windows-test:
  359. needs: windows-build
  360. runs-on: windows-latest
  361. env:
  362. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  363. PLATFORM: windows
  364. TEST: ${{matrix.target}}
  365. HXCPP_COMPILE_CACHE: ~/hxcache
  366. ARCH: 32
  367. strategy:
  368. fail-fast: false
  369. matrix:
  370. # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601
  371. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024
  372. target: [macro, js, hl, cpp, java, cs, php, python, neko]
  373. steps:
  374. - uses: actions/checkout@main
  375. with:
  376. submodules: recursive
  377. - uses: actions/download-artifact@v1
  378. with:
  379. name: win${{env.ARCH}}Binaries
  380. - name: Install Neko using snapshot from S3 (Windows)
  381. if: startsWith(env.PLATFORM, 'windows')
  382. shell: pwsh
  383. run: |
  384. $DOWNLOADDIR="./temp"
  385. new-item -Name $DOWNLOADDIR -ItemType directory
  386. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  387. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  388. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  389. Write-Host "::add-path::$NEKOPATH"
  390. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  391. - name: Print Neko version
  392. run: neko -version 2>&1
  393. # - name: Quick test
  394. # shell: pwsh
  395. # run: |
  396. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  397. # new-item -Name $DOWNLOADDIR -ItemType directory
  398. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  399. - name: Setup Haxe
  400. shell: pwsh
  401. run: |
  402. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  403. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  404. Set-PSDebug -Trace 1
  405. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  406. Write-Host "::add-path::$HAXEPATH"
  407. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  408. - name: Print Haxe version
  409. shell: pwsh
  410. run: haxe -version
  411. - name: "Make Python 3 be available as python3 in the cmdline"
  412. shell: pwsh
  413. run: |
  414. Set-PSDebug -Trace 1
  415. $pypath = python -c "import sys; print(sys.executable)"
  416. $py3path = $pypath.replace("python.exe","python3.exe")
  417. cmd /c mklink $py3path $pypath
  418. python3 -V
  419. - name: Install hererocks
  420. if: matrix.target == 'lua'
  421. shell: cmd
  422. run: |
  423. pip install hererocks
  424. hererocks lua53 -l5.3 -rlatest
  425. call lua53/bin/activate
  426. - name: Setup haxelib
  427. shell: pwsh
  428. run: |
  429. mkdir "$env:HAXELIB_ROOT"
  430. haxelib setup "$env:HAXELIB_ROOT"
  431. - name: Test
  432. shell: pwsh
  433. run: haxe RunCi.hxml
  434. working-directory: ${{github.workspace}}/tests
  435. linux-test:
  436. needs: linux-build
  437. runs-on: ubuntu-latest
  438. env:
  439. PLATFORM: linux64
  440. TEST: ${{matrix.target}}
  441. HXCPP_COMPILE_CACHE: ~/hxcache
  442. strategy:
  443. fail-fast: false
  444. matrix:
  445. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko]
  446. include:
  447. - target: js
  448. # SAUCE: 1
  449. # SAUCE_TUNNEL_ID: 'linux-test'
  450. # SAUCE_BUILD: '${{env.GITHUB_RUN_NUMBER}}' # $(Build.BuildNumber)
  451. - target: hl
  452. APT_PACKAGES: cmake ninja-build libturbojpeg-dev
  453. - target: cpp
  454. APT_PACKAGES: gcc-multilib g++-multilib
  455. - target: lua
  456. APT_PACKAGES: ncurses-dev
  457. - target: flash9
  458. APT_PACKAGES: libglib2.0 libfreetype6 xvfb
  459. steps:
  460. - uses: actions/checkout@main
  461. with:
  462. submodules: recursive
  463. - uses: actions/download-artifact@v1
  464. with:
  465. name: linuxBinaries
  466. - name: Install Neko using apt-get (Linux)
  467. if: (startsWith(env.PLATFORM, 'linux'))
  468. run: |
  469. set -ex
  470. sudo add-apt-repository ppa:haxe/snapshots -y
  471. sudo apt-get update -qqy
  472. sudo apt-get install -qqy neko
  473. - name: Print Neko version
  474. run: neko -version 2>&1
  475. - name: Setup Haxe
  476. run: |
  477. # mkdir ./linuxBinaries
  478. # curl -sSL https://build.haxe.org/builds/haxe/linux64/haxe_latest.tar.gz -o ./linuxBinaries/haxe_bin.tar.gz
  479. sudo apt install -qqy libmbedtls-dev
  480. set -ex
  481. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  482. sudo mkdir -p /usr/local/bin/
  483. sudo mkdir -p /usr/local/share/haxe/
  484. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  485. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  486. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  487. - name: Print Haxe version
  488. run: haxe -version
  489. - name: Setup haxelib
  490. run: |
  491. set -ex
  492. mkdir ~/haxelib
  493. haxelib setup ~/haxelib
  494. - name: Install apt packages
  495. if: matrix.APT_PACKAGES
  496. run: |
  497. set -ex
  498. sudo apt update -qqy
  499. sudo apt install -qqy ${{matrix.APT_PACKAGES}}
  500. - name: Flash setup
  501. if: matrix.target == 'flash9'
  502. run: export DISPLAY=:99.0
  503. - name: Test
  504. if: success() && !(matrix.SAUCE && matrix.SAUCE_ACCESS_KEY)
  505. run: haxe RunCi.hxml
  506. working-directory: ${{github.workspace}}/tests
  507. - name: Test (with SauceLabs)
  508. if: matrix.target == 'js' && success() && matrix.SAUCE && matrix.SAUCE_ACCESS_KEY
  509. run: haxe RunCi.hxml
  510. working-directory: ${{github.workspace}}/tests
  511. env:
  512. SAUCE_ACCESS_KEY: matrix.SAUCE_ACCESS_KEY
  513. mac-test:
  514. needs: mac-build
  515. runs-on: macos-latest
  516. env:
  517. PLATFORM: mac
  518. TEST: ${{matrix.target}}
  519. HXCPP_COMPILE_CACHE: ~/hxcache
  520. strategy:
  521. fail-fast: false
  522. matrix:
  523. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko]
  524. include:
  525. - target: hl
  526. BREW_PACKAGES: ninja
  527. steps:
  528. - uses: actions/checkout@main
  529. with:
  530. submodules: recursive
  531. - uses: actions/download-artifact@v1
  532. with:
  533. name: macBinaries
  534. - name: Install Neko using homebrew (Mac)
  535. if: (startsWith(env.PLATFORM, 'mac'))
  536. run: |
  537. set -ex
  538. HOMEBREW_NO_AUTO_UPDATE=1
  539. brew install neko
  540. - name: Print Neko version
  541. run: neko -version 2>&1
  542. - name: Setup Haxe
  543. run: |
  544. # mkdir ./macBinaries
  545. # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz
  546. set -ex
  547. tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
  548. sudo mkdir -p /usr/local/bin/
  549. sudo mkdir -p /usr/local/share/haxe/
  550. sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
  551. sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
  552. sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
  553. - name: Print Haxe version
  554. run: haxe -version
  555. - name: Setup haxelib
  556. run: |
  557. set -ex
  558. mkdir ~/haxelib
  559. haxelib setup ~/haxelib
  560. - name: Install homebrew packages
  561. if: matrix.BREW_PACKAGES
  562. run: brew install ${{matrix.BREW_PACKAGES}}
  563. - name: Test
  564. run: |
  565. # disable invalid Unicode filenames on APFS
  566. echo "" > sys/compile-fs.hxml
  567. haxe RunCi.hxml
  568. working-directory: ${{github.workspace}}/tests
  569. deploy:
  570. if: github.event_name != 'pull_request'
  571. needs: [linux-test, mac-test, windows-test, windows64-test]
  572. runs-on: ubuntu-latest
  573. steps:
  574. # this is only needed for to get `COMMIT_DATE`...
  575. # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
  576. # would be faster
  577. - name: Checkout the repository
  578. uses: actions/checkout@main
  579. - name: Download build artifacts
  580. uses: actions/download-artifact@v2
  581. - name: Install awscli
  582. run: |
  583. set -ex
  584. sudo apt-get update -qqy
  585. sudo apt-get install -qqy awscli
  586. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  587. - name: Extract branch name
  588. id: extract_branch
  589. shell: bash
  590. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  591. - name: Upload binaries
  592. shell: bash
  593. env:
  594. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  595. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  596. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  597. run: |
  598. set -ex
  599. COMMIT_HASH_SHORT=${GITHUB_SHA:0:7}
  600. COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"`
  601. FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT}
  602. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz
  603. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz
  604. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz
  605. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
  606. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
  607. aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
  608. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/${FILE_NAME}.zip
  609. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/${FILE_NAME}.zip
  610. aws s3 cp win32Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows-choco/
  611. - name: Update "latest"
  612. if: github.ref == 'refs/heads/development'
  613. shell: bash
  614. env:
  615. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  616. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  617. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  618. run: |
  619. set -ex
  620. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz
  621. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz
  622. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
  623. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
  624. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
  625. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/haxe_latest.zip
  626. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/haxe_latest.zip
  627. # Chocolatey packages have to be named with version number,
  628. # so let's use web redirection to keep the original file name.
  629. [[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
  630. [[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  631. aws s3 cp ${HXBUILDS_S3ADDR}/haxe/windows64-choco/${FILE_NAME} ${HXBUILDS_S3ADDR}/haxe/windows64-choco/haxe_latest.nupkg --acl public-read --website-redirect "${HXBUILDS_S3PATH}/haxe/windows64-choco/${FILE_NAME}"
  632. [[ `echo win32Binaries/*.nupkg` =~ win32Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  633. aws s3 cp ${HXBUILDS_S3ADDR}/haxe/windows-choco/${FILE_NAME} ${HXBUILDS_S3ADDR}/haxe/windows-choco/haxe_latest.nupkg --acl public-read --website-redirect "${HXBUILDS_S3PATH}/haxe/windows-choco/${FILE_NAME}"
  634. deploy_apidoc:
  635. if: github.event_name != 'pull_request' # TODO: also only when `GHP_REMOTE` is present
  636. needs: [linux-test, mac-test, windows-test, windows64-test]
  637. runs-on: ubuntu-latest
  638. steps:
  639. - name: Download Haxe
  640. uses: actions/download-artifact@v2
  641. with:
  642. name: linuxBinaries
  643. path: linuxBinaries
  644. - name: Setup Haxe
  645. run: |
  646. set -ex
  647. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  648. sudo mkdir -p /usr/local/bin/
  649. sudo mkdir -p /usr/local/share/haxe/
  650. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  651. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  652. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  653. - name: Download xmldoc artifact
  654. uses: actions/download-artifact@v2
  655. with:
  656. name: xmldoc
  657. path: xmldoc
  658. - name: Deploy to api.haxe.org
  659. env:
  660. GHP_EMAIL: [email protected]
  661. GHP_USERNAME: Haxe CI Bot
  662. GHP_REMOTE: ${{ secrets.GHP_REMOTE }}
  663. run: |
  664. set -ex
  665. LOCAL="`pwd`/extra/api.haxe.org"
  666. git clone "${GHP_REMOTE}" "${LOCAL}"
  667. haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"