about summary refs log tree commit diff stats
path: root/.github/workflows
diff options
context:
space:
mode:
authorSeas0 <30485844+Seas0@users.noreply.github.com>2022-01-07 16:37:23 +0800
committerSeas0 <30485844+Seas0@users.noreply.github.com>2022-01-07 16:43:52 +0800
commit42ab23a8332aaeee4e4a47e2608fba09833b46be (patch)
treec44b9a1341ba13806c811ebe6362e3cf83d6b149 /.github/workflows
parent5e01769622b0d5edda8e42c994eff171887cc1d8 (diff)
downloadbox64-42ab23a8332aaeee4e4a47e2608fba09833b46be.tar.gz
box64-42ab23a8332aaeee4e4a47e2608fba09833b46be.zip
Sync configuration from box86
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/manual.yml95
-rw-r--r--.github/workflows/release.yml23
2 files changed, 111 insertions, 7 deletions
diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml
new file mode 100644
index 00000000..baba3877
--- /dev/null
+++ b/.github/workflows/manual.yml
@@ -0,0 +1,95 @@
+### Manual build Box64 with Github Action
+name: Custom build Box64
+
+on:
+  workflow_dispatch:
+    inputs:
+      platform:
+        description: 'Target platform name'
+        required: true
+        default: 'GENERIC_ARM'
+        type: choice
+        options:
+        - X64
+        - GENERIC_ARM
+        - PHYTIUM
+        - RK3288
+        - RK3326
+        - RK3399
+        - RPI4ARM64
+        - SD845
+        - TEGRAX1
+      build_type:
+        description: 'Build type'
+        required: true
+        default: 'RelWithDebInfo'
+        type: choice
+        options:
+        - RelWithDebInfo
+        - Release
+        - Debug
+        - MinSizeRel
+      dynarec:
+        description: 'Enable dynarec'
+        required: false
+        default: 'true'
+        type: boolean
+      trace:
+        description: 'Enable trace'
+        required: false
+        default: 'false'
+        type: boolean
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - name: "Checkout Box64 Repository"
+        uses: actions/checkout@v2
+
+      - name: "Environment preparation"
+        run: |
+          sudo apt-get update
+          if [[ ${{ github.event.inputs.platform }} != 'X64' && ${{ github.event.inputs.platform }} != 'GENERIC_ARM' ]]; then
+            echo "BOX64_PLATFORM_MARCRO=-D${{ github.event.inputs.platform }}=1" >> $GITHUB_ENV
+            echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+            sudo apt-get -y install git gcc-aarch64-linux-gnu cmake make python3
+          else
+            if [[ ${{ github.event.inputs.platform }} == 'X64' ]]; then
+              echo "BOX64_PLATFORM_MARCRO=-DLD80BITS=1 -DNOALIGN=1" >> $GITHUB_ENV
+              echo "BOX64_COMPILER=gcc" >> $GITHUB_ENV
+              sudo apt-get -y install git cmake make python3
+            else
+              echo BOX64_PLATFORM_MARCRO="-DARM_DYNAREC=ON" >> $GITHUB_ENV
+              echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+              sudo apt-get -y install git gcc-aarch64-linux-gnu cmake make python3
+            fi
+          fi
+
+      - name: "Display Build info"
+        run: |
+          echo "CMake Platform Macro: ${{ env.BOX64_PLATFORM_MARCRO }}"
+          echo "CMake C Compiler: ${{ env.BOX64_COMPILER }}"
+          echo "Build type: ${{ github.event.inputs.build_type }}"
+          echo "Dynarec Enabled: ${{ github.event.inputs.dynarec }}"
+          echo "Trace Enabled: ${{ github.event.inputs.trace }}"
+
+      - name: "Build Box64"
+        run: |
+          mkdir build
+          cd build
+          cmake .. -DCMAKE_C_COMPILER=${{ env.BOX64_COMPILER }} ${{ env.BOX64_PLATFORM_MARCRO }}\
+                   -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }}\
+                   -DARM_DYNAREC:BOOL=${{ github.event.inputs.dynarec }}\
+                   -DHAVE_TRACE:BOOL=${{ github.event.inputs.trace }}\
+                   -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
+          make -j$(nproc) VERBOSE=1
+
+      - name: "Upload Artifact"
+        uses: actions/upload-artifact@v2
+        with:
+          name: box64-${{ github.event.inputs.platform }}-${{ github.event.inputs.build_type }}
+          path: build/box64
+
+
+
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 46cf94d1..ff83117a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,7 +1,7 @@
 ### Auto build Box64 and release its binary with Github Action
 name: Build and Release Box64
 
-on: 
+on:
   workflow_dispatch:
   release:
   push:
@@ -12,7 +12,7 @@ on:
       - "**/*.py"
       - "CMakeLists.txt"
       - "**/*.yml"
-  pull_request: 
+  pull_request:
     types: [assigned, opened, synchronize, reopened]
     paths:
       - "**/*.c"
@@ -47,7 +47,6 @@ jobs:
               echo "BOX64_PLATFORM_MARCRO=-DLD80BITS=1 -DNOALIGN=1" >> $GITHUB_ENV
               echo "BOX64_COMPILER=gcc" >> $GITHUB_ENV
               sudo apt-get -y install git cmake make python3
-              ls /bin/*gcc*
             else
               echo BOX64_PLATFORM_MARCRO="-DARM_DYNAREC=ON" >> $GITHUB_ENV
               echo "BOX64_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
@@ -61,21 +60,31 @@ jobs:
             echo BOX64_BUILD_TYPE=RelWithDebInfo >> $GITHUB_ENV
             echo BOX64_HAVE_TRACE=1 >> $GITHUB_ENV
           fi
-            
+
       - name: "Display Build info"
         run: |
           echo "CMake Platform Macro: ${{ env.BOX64_PLATFORM_MARCRO }}"
           echo "CMake C Compiler: ${{ env.BOX64_COMPILER }}"
           echo "Build type: ${{ env.BOX64_BUILD_TYPE }}"
           echo "Trace Enabled: ${{ env.BOX64_HAVE_TRACE }}"
-          
+
       - name: "Build Box64"
         run: |
           mkdir build
           cd build
-          cmake .. -DCMAKE_C_COMPILER=${{ env.BOX64_COMPILER }} ${{ env.BOX64_PLATFORM_MARCRO }} -DCMAKE_BUILD_TYPE=${{ env.BOX64_BUILD_TYPE }} -DHAVE_TRACE=${{ env.BOX64_HAVE_TRACE }} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
+          cmake .. -DCMAKE_C_COMPILER=${{ env.BOX64_COMPILER }}\
+                   ${{ env.BOX64_PLATFORM_MARCRO }}\
+                   -DCMAKE_BUILD_TYPE=${{ env.BOX64_BUILD_TYPE }}\
+                   -DHAVE_TRACE=${{ env.BOX64_HAVE_TRACE }}\
+                   -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
           make -j$(nproc) VERBOSE=1
-      
+
+      - name: "Test Box64"
+        if: ${{ matrix.platform == 'X64' }}
+        run: |
+          cd build
+          ctest -j$(nproc)
+
       - name: "Upload Artifact"
         uses: actions/upload-artifact@v2
         with: