From 28cbc297d1c90db791d41d24bd80bc5ec150300b Mon Sep 17 00:00:00 2001
From: Mix <32300164+mnixry@users.noreply.github.com>
Date: Fri, 2 Apr 2021 21:53:20 +0800
Subject: [PATCH] add artifact upload and parallel compling

---
 .github/workflows/main.yml | 42 ++++++++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9f61cd4..d76adbc 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,24 +6,54 @@ name: CI
 # events but only for the master branch
 on:
   push:
-    branches: [ master ]
+    branches: [master]
   pull_request:
-    branches: [ master ]
+    branches: [master]
 
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
   # This workflow contains a single job called "build"
   build:
+    name: Image Build
     # The type of runner that the job will run on
     runs-on: ubuntu-latest
 
+    strategy:
+      matrix:
+        device:
+          - dipper
+          - enchilada
+          - fajita
+          - polaris
+          - beryllium
+          - perseus
+          - nx616j
+          - m1882
+          - skr-a0
+          - judyln
+          - star2qltechn
+          - dipper-old
+          - pafm00
+          - trident
+
     # Steps represent a sequence of tasks that will be executed as part of the job
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
-      - uses: actions/checkout@v2
+      - name: Checkout repository
+        uses: actions/checkout@v2
 
       - name: Install requires packages
-        run: sudo apt update&&sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git
+        run: |
+          sudo apt-get update
+          sudo apt-get -y install build-essential uuid-dev iasl nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git
+
+      - name: Build device ${{ matrix.device }}
+        run: |
+          ./build.sh --device ${{ matrix.device }}
 
-      - name: Build all devices
-        run: ./build.sh -a
+      - name: Upload a Build Artifact
+        uses: actions/upload-artifact@v2
+        with: # Artifact name
+          name: ${{ matrix.device }}
+          # A file, directory or wildcard pattern that describes what to upload
+          path: ./*.img
-- 
2.49.0