From 1d0ba0ea8544fc5f6f6a2d2d5c6294daffc5b6d9 Mon Sep 17 00:00:00 2001 From: Arnav Mehta <77837038+ArnavMehta3000@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:02:18 +0100 Subject: [PATCH 1/3] Create macosx.yml --- .github/workflows/macosx.yml | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/macosx.yml diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml new file mode 100644 index 0000000..124e962 --- /dev/null +++ b/.github/workflows/macosx.yml @@ -0,0 +1,80 @@ +name: Windows + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + mode: [ debug, release ] + rhi: [ metal, opengl ] # Add vulkan support + # rhi: [ dx11, dx12, opengl, vulkan ] + + steps: + - name: Get current date as package key + id: cache_key + run: echo "key=$(date +'%W')" >> $GITHUB_ENV + shell: bash + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set xmake env + run: echo "XMAKE_GLOBALDIR=${{ github.workspace }}/xmake-global" >> $GITHUB_ENV + + # Install xmake + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + actions-cache-folder: .xmake-cache-W${{ env.key }} + + - name: Update xmake repository + run: xmake repo --update + + - name: Retrieve dependencies hash + id: dep_hash + run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_ENV + shell: bash + + - name: Restore cached xmake dependencies + id: restore-depcache + uses: actions/cache/restore@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ matrix.rhi }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ env.hash }}-W${{ env.key }} + + - name: Check xmake packages directory exists + shell: bash + run: | + if [ -d "${{ env.XMAKE_GLOBALDIR }}/.xmake/packages" ]; then + echo "Packages directory exists." + ls -la "${{ env.XMAKE_GLOBALDIR }}/.xmake/packages" + else + echo "Packages directory does not exist." + fi + + - name: Configure xmake and install dependencies + run: xmake config --mode=${{ matrix.mode }} --ccache=n --rhi=${{ matrix.rhi }} --yes + + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + + - name: Build Visualizer + run: xmake --all --yes + + - name: Run compile tests + run: xmake test */compile_pass + + - name: Run tests + run: xmake test */run_5_seconds From 610b42c16c11253ebf465eb592370194e1875508 Mon Sep 17 00:00:00 2001 From: Arnav Mehta <77837038+ArnavMehta3000@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:04:09 +0100 Subject: [PATCH 2/3] Update macosx.yml --- .github/workflows/macosx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml index 124e962..37c231f 100644 --- a/.github/workflows/macosx.yml +++ b/.github/workflows/macosx.yml @@ -1,4 +1,4 @@ -name: Windows +name: MacOSX on: pull_request: From 16b0a0c34acdf965c4d28e1e38fbc6727f29b1c9 Mon Sep 17 00:00:00 2001 From: Arnav Mehta <77837038+ArnavMehta3000@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:13:52 +0100 Subject: [PATCH 3/3] Create linux.yml --- .github/workflows/linux.yml | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..0f8123e --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,80 @@ +name: Linux + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + mode: [ debug, release ] + rhi: [ opengl ] # Add vulkan + # rhi: [ dx11, dx12, opengl, vulkan, metal ] + + steps: + - name: Get current date as package key + id: cache_key + run: echo "key=$(date +'%W')" >> $GITHUB_ENV + shell: bash + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set xmake env + run: echo "XMAKE_GLOBALDIR=${{ github.workspace }}/xmake-global" >> $GITHUB_ENV + + # Install xmake + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + actions-cache-folder: .xmake-cache-W${{ env.key }} + + - name: Update xmake repository + run: xmake repo --update + + - name: Retrieve dependencies hash + id: dep_hash + run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_ENV + shell: bash + + - name: Restore cached xmake dependencies + id: restore-depcache + uses: actions/cache/restore@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ matrix.rhi }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ env.hash }}-W${{ env.key }} + + - name: Check xmake packages directory exists + shell: bash + run: | + if [ -d "${{ env.XMAKE_GLOBALDIR }}/.xmake/packages" ]; then + echo "Packages directory exists." + ls -la "${{ env.XMAKE_GLOBALDIR }}/.xmake/packages" + else + echo "Packages directory does not exist." + fi + + - name: Configure xmake and install dependencies + run: xmake config --mode=${{ matrix.mode }} --ccache=n --rhi=${{ matrix.rhi }} --yes + + - name: Save cached xmake dependencies + if: ${{ !steps.restore-depcache.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ steps.restore-depcache.outputs.cache-primary-key }} + + - name: Build Visualizer + run: xmake --all --yes + + - name: Run compile tests + run: xmake test */compile_pass + + - name: Run tests + run: xmake test */run_5_seconds