Browse Source

set GITHUB_WORKSPACE for all +test-*, revise +build to include git info

Andy Li 3 years ago
parent
commit
b25e18df3f
2 changed files with 12 additions and 24 deletions
  1. 12 18
      Earthfile
  2. 0 6
      tests/server/src/cases/display/issues/Issue9087.hx

+ 12 - 18
Earthfile

@@ -164,7 +164,7 @@ build:
     ARG ADD_REVISION
     ARG ADD_REVISION
 
 
     # Copy files
     # Copy files
-    COPY --dir extra libs plugins src* std dune* Makefile* opam .
+    COPY --dir .git extra libs plugins src* std dune* Makefile* opam .
 
 
     # Install OCaml libraries
     # Install OCaml libraries
     RUN set -ex && \
     RUN set -ex && \
@@ -176,18 +176,13 @@ build:
         ocamlopt -v
         ocamlopt -v
 
 
     # Build Haxe
     # 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
-
-    SAVE ARTIFACT std
-    SAVE ARTIFACT ./out/* AS LOCAL out/$TARGETPLATFORM/
-    SAVE ARTIFACT ./haxe* AS LOCAL out/$TARGETPLATFORM/
+    RUN opam config exec -- make -s -j`nproc` STATICLINK=1 haxe && ldd -v ./haxe
+    RUN opam config exec -- make -s haxelib && ldd -v ./haxelib
+    RUN make -s package_unix && ls -l out
+
+    SAVE ARTIFACT --keep-ts ./out/* AS LOCAL out/$TARGETPLATFORM/
+    SAVE ARTIFACT --keep-ts ./haxe AS LOCAL out/$TARGETPLATFORM/
+    SAVE ARTIFACT --keep-ts ./haxelib AS LOCAL out/$TARGETPLATFORM/
     SAVE IMAGE --cache-hint
     SAVE IMAGE --cache-hint
 
 
 build-multiarch:
 build-multiarch:
@@ -213,7 +208,7 @@ xmldoc:
         haxe doc.hxml                                                && \
         haxe doc.hxml                                                && \
         echo "{\"commit\":\"$COMMIT\",\"branch\":\"$BRANCH\"}" > doc/info.json
         echo "{\"commit\":\"$COMMIT\",\"branch\":\"$BRANCH\"}" > doc/info.json
 
 
-    SAVE ARTIFACT ./extra/doc/* AS LOCAL extra/doc/
+    SAVE ARTIFACT --keep-ts ./extra/doc/* AS LOCAL extra/doc/
 
 
 test-environment:
 test-environment:
     # we use a sightly newer ubuntu for easier installation of the target runtimes (e.g. php)
     # we use a sightly newer ubuntu for easier installation of the target runtimes (e.g. php)
@@ -279,14 +274,13 @@ test-environment-cpp:
     ARG TARGETPLATFORM
     ARG TARGETPLATFORM
 
 
     IF [ "$TARGETPLATFORM" = "linux/amd64" ]
     IF [ "$TARGETPLATFORM" = "linux/amd64" ]
-        ENV PACKAGES=g++-multilib
+        DO +INSTALL_PACKAGES --PACKAGES="g++-multilib"
     ELSE IF [ "$TARGETPLATFORM" = "linux/arm64" ]
     ELSE IF [ "$TARGETPLATFORM" = "linux/arm64" ]
-        ENV PACKAGES=g++-multilib-arm-linux-gnueabi
+        DO +INSTALL_PACKAGES --PACKAGES="g++-multilib-arm-linux-gnueabi"
     ELSE
     ELSE
         RUN echo "Unsupported platform $TARGETPLATFORM" && exit 1
         RUN echo "Unsupported platform $TARGETPLATFORM" && exit 1
     END
     END
 
 
-    DO +INSTALL_PACKAGES --PACKAGES=$PACKAGES
     SAVE IMAGE --cache-hint
     SAVE IMAGE --cache-hint
 
 
 RUN_CI:
 RUN_CI:
@@ -295,6 +289,7 @@ RUN_CI:
     RUN mkdir /haxelib && haxelib setup /haxelib
     RUN mkdir /haxelib && haxelib setup /haxelib
     WORKDIR tests
     WORKDIR tests
     ARG --required TEST
     ARG --required TEST
+    ENV GITHUB_WORKSPACE=true # emulate github environment, TODO: properly define a "Earthly" environment
     ENV TEST="$TEST"
     ENV TEST="$TEST"
     RUN haxe RunCi.hxml
     RUN haxe RunCi.hxml
 
 
@@ -312,7 +307,6 @@ test-js:
 
 
 test-hl:
 test-hl:
     FROM +test-environment-hl
     FROM +test-environment-hl
-    ENV GITHUB_WORKSPACE=true # emulate github environment, TODO: properly define a "Earthly" environment
     DO +RUN_CI --TEST=hl
     DO +RUN_CI --TEST=hl
 
 
 test-cpp:
 test-cpp:

+ 0 - 6
tests/server/src/cases/display/issues/Issue9087.hx

@@ -17,12 +17,6 @@ class Issue9087 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test(async:utest.Async) {
 	function test(async:utest.Async) {
-		//TODO: https://github.com/HaxeFoundation/haxe/pull/9529
-		if(Sys.getEnv("GITHUB_WORKSPACE") != null) {
-			Assert.pass();
-			async.done();
-			return;
-		}
 		runHaxeJson([], DisplayMethods.GotoImplementation, {file: file, offset: offset(1), contents: source});
 		runHaxeJson([], DisplayMethods.GotoImplementation, {file: file, offset: offset(1), contents: source});
 		var result = parseGotoDefintion().result;
 		var result = parseGotoDefintion().result;
 		Assert.equals(1, result.length);
 		Assert.equals(1, result.length);