瀏覽代碼

[CI] Update CI

Rudy Ges 4 月之前
父節點
當前提交
72a9fbe4e4
共有 2 個文件被更改,包括 41 次插入21 次删除
  1. 39 20
      .github/workflows/main.yml
  2. 2 1
      haxe.opam

+ 39 - 20
.github/workflows/main.yml

@@ -50,15 +50,25 @@ jobs:
       - name: Print Neko version
         run: neko -version 2>&1
 
+      # TODO: less hacky path handling
+      # - name: Install pkg-config
+      #   shell: pwsh
+      #   run: |
+      #     Set-PSDebug -Trace 1
+      #     Invoke-WebRequest http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/pkg-config_0.23-2_win64.zip -OutFile $env:RUNNER_TEMP/pkg-config.zip
+      #     Expand-Archive $env:RUNNER_TEMP/pkg-config.zip -DestinationPath $env:RUNNER_TEMP
+      #     Copy-Item -Path $env:RUNNER_TEMP/bin/pkg-config.exe -Destination D:\cygwin\bin\
+
       - name: Setup ocaml
-        uses: ocaml/setup-ocaml@v2
+        uses: ocaml/setup-ocaml@3d85bf33a66e089149cd1e9c75da7b9cb6d9d3a7
         with:
-          ocaml-compiler: 4.08.1
+          ocaml-compiler: 4.14.0
           opam-repositories: |
             opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
             default: https://github.com/ocaml/opam-repository.git
           opam-local-packages: |
             haxe.opam
+          cache-prefix: w64-v1-4.3.7
 
       - name: Install dependencies
         shell: pwsh
@@ -165,34 +175,43 @@ jobs:
       - name: Print Neko version
         run: neko -version 2>&1
 
+      # TODO: less hacky path handling
+      # - name: Install pkg-config
+      #   shell: pwsh
+      #   run: |
+      #     Set-PSDebug -Trace 1
+      #     Invoke-WebRequest http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip -OutFile $env:RUNNER_TEMP/pkg-config.zip
+      #     Expand-Archive $env:RUNNER_TEMP/pkg-config.zip -DestinationPath $env:RUNNER_TEMP
+      #     Copy-Item -Path $env:RUNNER_TEMP/bin/pkg-config.exe -Destination D:\cygwin\bin\
+
       - name: Setup ocaml
         id: ocaml
         continue-on-error: true
-        uses: kLabz/setup-ocaml@win32
+        uses: ocaml/setup-ocaml@3d85bf33a66e089149cd1e9c75da7b9cb6d9d3a7
         with:
-          ocaml-compiler: 4.08.1
+          ocaml-compiler: 4.14.0
           opam-depext: false
           opam-repositories: |
             opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
             default: https://github.com/ocaml/opam-repository.git
           opam-local-packages: |
             haxe.opam
-          cache-prefix: w32-v1
+          cache-prefix: w32-v1-4.3.7
 
       # TODO make it work on first try
       # (when cygwin cache doesn't exist, ocaml install fails with a curl error)
       - name: Setup ocaml (second chance)
         if: steps.ocaml.outcome == 'failure'
-        uses: kLabz/setup-ocaml@win32
+        uses: ocaml/setup-ocaml@3d85bf33a66e089149cd1e9c75da7b9cb6d9d3a7
         with:
-          ocaml-compiler: 4.08.1
+          ocaml-compiler: 4.14.0
           opam-depext: false
           opam-repositories: |
             opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
             default: https://github.com/ocaml/opam-repository.git
           opam-local-packages: |
             haxe.opam
-          cache-prefix: w32-v1
+          cache-prefix: w32-v1-4.3.7
 
       - name: Install dependencies
         shell: pwsh
@@ -255,14 +274,14 @@ jobs:
 
 
   linux-build:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     env:
       PLATFORM: linux64
       OPAMYES: 1
     strategy:
       fail-fast: false
       matrix:
-        ocaml: ["4.08.1", "5.3.0"]
+        ocaml: ["4.14.0", "5.3.0"]
     steps:
       - uses: actions/checkout@main
         with:
@@ -298,10 +317,10 @@ jobs:
       - 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 libpcre2-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build libstring-shellquote-perl libipc-system-simple-perl
+          sudo apt-get install -qqy darcs bubblewrap ocaml-nox libpcre2-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build libstring-shellquote-perl libipc-system-simple-perl
+          curl -sSL https://github.com/ocaml/opam/releases/download/2.3.0/opam-2.3.0-x86_64-linux -o $RUNNER_TEMP/opam
+          sudo install $RUNNER_TEMP/opam /usr/local/bin/opam
 
       - name: Install OCaml libraries
         if: steps.cache-opam.outputs.cache-hit != 'true'
@@ -337,7 +356,7 @@ jobs:
         run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
 
       - name: Build xmldoc
-        if: matrix.ocaml == '4.08.1'
+        if: matrix.ocaml == '4.14.0'
         run: |
           set -ex
           make -s xmldoc
@@ -356,14 +375,14 @@ jobs:
 
       - name: Upload xmldoc artifact
         uses: actions/upload-artifact@v4
-        if: matrix.ocaml == '4.08.1'
+        if: matrix.ocaml == '4.14.0'
         with:
           name: xmldoc
           path: extra/doc
 
   linux-test:
     needs: linux-build
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     env:
       PLATFORM: linux64
       TEST: ${{matrix.target}}
@@ -372,7 +391,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        ocaml: ["4.08.1", "5.3.0"]
+        ocaml: ["4.14.0", "5.3.0"]
         target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash, neko]
         include:
           - target: hl
@@ -450,7 +469,7 @@ jobs:
 
   test-docgen:
     needs: linux-build
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     env:
       PLATFORM: linux64
       HXCPP_COMPILE_CACHE: ~/hxcache
@@ -1105,7 +1124,7 @@ jobs:
   deploy:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
     needs: [linux-test, linux-arm64-test, mac-test, windows-test, windows64-test]
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     steps:
       # this is only needed for to get `COMMIT_DATE`...
       # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
@@ -1181,7 +1200,7 @@ jobs:
   deploy_apidoc:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
     needs: [linux-test, linux-arm64-test, mac-test, windows-test, windows64-test]
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     steps:
       - name: Install dependencies
         run: |

+ 2 - 1
haxe.opam

@@ -20,7 +20,7 @@ install: [make "install" "INSTALL_DIR=%{prefix}%"]
 remove: [make "uninstall" "INSTALL_DIR=%{prefix}%"]
 depends: [
   ("ocaml" {>= "5.0"} & ("camlp5" {build}))
-    | ("ocaml" {>= "4.08" & < "5.0"} & ("camlp5" {build & = "8.00.03"}))
+    | ("ocaml" {>= "4.14.0" & < "5.0"} & ("camlp5" {build & = "8.00.03"}))
   "ocamlfind" {build}
   "dune" {>= "1.11" & < "3.16"}
   "sedlex" {>= "2.0"}
@@ -32,5 +32,6 @@ depends: [
   "conf-libpcre2-8"
   "conf-zlib"
   "conf-neko"
+  "conf-pkg-config"
   "luv" {= "0.5.13"}
 ]