Browse Source

[CI] do not use seperate build/test jobs for Linux

such that +test-all may make use of the local build cache from +build
Andy Li 3 years ago
parent
commit
3860f75f44
2 changed files with 22 additions and 68 deletions
  1. 11 34
      .github/workflows/main.yml
  2. 11 34
      extra/github-actions/workflows/main.yml

+ 11 - 34
.github/workflows/main.yml

@@ -229,7 +229,7 @@ jobs:
           path: out
       
 
-  linux-amd64-build:
+  linux-amd64:
     runs-on: ubuntu-18.04
     steps:
       - name: Login to GitHub Container Registry
@@ -270,7 +270,12 @@ jobs:
           name: linuxBinaries
           path: out/linux/amd64
 
-  linux-arm64-build:
+      - name: Test
+        run: earthly --platform=linux/amd64 --remote-cache=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):cache-test-${{github.ref_name}}-amd64 +test-all
+        env:
+          EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
+
+  linux-arm64:
     runs-on: ubuntu-18.04
     steps:
       - name: Login to GitHub Container Registry
@@ -309,6 +314,8 @@ jobs:
           name: linuxArm64Binaries
           path: out/linux/arm64
 
+      # Do not run test for arm64 for now
+
   mac-build:
     runs-on: macos-latest
     env:
@@ -615,36 +622,6 @@ jobs:
         working-directory: ${{github.workspace}}/tests
       
 
-  linux-amd64-test:
-    needs: linux-amd64-build
-    runs-on: ubuntu-18.04
-    steps:
-      - name: Login to GitHub Container Registry
-        uses: docker/login-action@v1
-        with:
-          registry: ghcr.io
-          username: ${{ github.actor }}
-          password: ${{ secrets.GITHUB_TOKEN }}
-
-      - uses: actions/checkout@main
-        with:
-          submodules: recursive
-
-      - name: Set up QEMU
-        id: qemu
-        uses: docker/setup-qemu-action@v1
-        with:
-            image: tonistiigi/binfmt:latest
-            platforms: all
-
-      - name: Install Earthly
-        run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.5/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'\
-
-      - name: Test
-        run: earthly --platform=linux/amd64 --remote-cache=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):cache-test-${{github.ref_name}}-amd64 +test-all
-        env:
-          EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
-
   mac-test:
     needs: mac-build
     runs-on: macos-latest
@@ -731,7 +708,7 @@ jobs:
 
   deploy:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
-    needs: [linux-amd64-test, linux-arm64-build, mac-test, windows-test, windows64-test]
+    needs: [linux-amd64, linux-arm64, mac-test, windows-test, windows64-test]
     runs-on: ubuntu-18.04
     steps:
       # this is only needed for to get `COMMIT_DATE`...
@@ -807,7 +784,7 @@ jobs:
 
   deploy_apidoc:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
-    needs: [linux-amd64-test, linux-arm64-build, mac-test, windows-test, windows64-test]
+    needs: [linux-amd64, linux-arm64, mac-test, windows-test, windows64-test]
     runs-on: ubuntu-18.04
     steps:
       - name: Download Haxe

+ 11 - 34
extra/github-actions/workflows/main.yml

@@ -52,7 +52,7 @@ jobs:
       @import install-neko.yml
       @import build-windows.yml
 
-  linux-amd64-build:
+  linux-amd64:
     runs-on: ubuntu-18.04
     steps:
       - name: Login to GitHub Container Registry
@@ -93,7 +93,12 @@ jobs:
           name: linuxBinaries
           path: out/linux/amd64
 
-  linux-arm64-build:
+      - name: Test
+        run: earthly --platform=linux/amd64 --remote-cache=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):cache-test-${{github.ref_name}}-amd64 +test-all
+        env:
+          EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
+
+  linux-arm64:
     runs-on: ubuntu-18.04
     steps:
       - name: Login to GitHub Container Registry
@@ -132,6 +137,8 @@ jobs:
           name: linuxArm64Binaries
           path: out/linux/arm64
 
+      # Do not run test for arm64 for now
+
   mac-build:
     runs-on: macos-latest
     env:
@@ -197,36 +204,6 @@ jobs:
       @import install-neko.yml
       @import test-windows.yml
 
-  linux-amd64-test:
-    needs: linux-amd64-build
-    runs-on: ubuntu-18.04
-    steps:
-      - name: Login to GitHub Container Registry
-        uses: docker/login-action@v1
-        with:
-          registry: ghcr.io
-          username: ${{ github.actor }}
-          password: ${{ secrets.GITHUB_TOKEN }}
-
-      - uses: actions/checkout@main
-        with:
-          submodules: recursive
-
-      - name: Set up QEMU
-        id: qemu
-        uses: docker/setup-qemu-action@v1
-        with:
-            image: tonistiigi/binfmt:latest
-            platforms: all
-
-      - name: Install Earthly
-        run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.5/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'\
-
-      - name: Test
-        run: earthly --platform=linux/amd64 --remote-cache=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):cache-test-${{github.ref_name}}-amd64 +test-all
-        env:
-          EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
-
   mac-test:
     needs: mac-build
     runs-on: macos-latest
@@ -254,7 +231,7 @@ jobs:
 
   deploy:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
-    needs: [linux-amd64-test, linux-arm64-build, mac-test, windows-test, windows64-test]
+    needs: [linux-amd64, linux-arm64, mac-test, windows-test, windows64-test]
     runs-on: ubuntu-18.04
     steps:
       # this is only needed for to get `COMMIT_DATE`...
@@ -330,7 +307,7 @@ jobs:
 
   deploy_apidoc:
     if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
-    needs: [linux-amd64-test, linux-arm64-build, mac-test, windows-test, windows64-test]
+    needs: [linux-amd64, linux-arm64, mac-test, windows-test, windows64-test]
     runs-on: ubuntu-18.04
     steps:
       - name: Download Haxe