From 394d2dc358c59428c961f56309cfd3e6a19cd7fa Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sun, 18 Jan 2026 15:55:18 +0100 Subject: [PATCH] adding windows CI --- .gitea/workflows/CI.yml | 48 ++++++++++++++++++++++++++++++++++++++ .gitea/workflows/linux.yml | 34 --------------------------- .gitea/workflows/macos.yml | 31 ------------------------ .gitignore | 2 ++ sandbox/Makefile | 10 -------- sandbox/xmake.lua | 11 +++++++++ 6 files changed, 61 insertions(+), 75 deletions(-) create mode 100644 .gitea/workflows/CI.yml delete mode 100644 .gitea/workflows/linux.yml delete mode 100644 .gitea/workflows/macos.yml delete mode 100644 sandbox/Makefile create mode 100644 sandbox/xmake.lua diff --git a/.gitea/workflows/CI.yml b/.gitea/workflows/CI.yml new file mode 100644 index 0000000..b2b2663 --- /dev/null +++ b/.gitea/workflows/CI.yml @@ -0,0 +1,48 @@ +name: Windows + +on: + repository_dispatch: + types: [create-pull-request] + pull_request: + push: + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'README.md' + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [windows-x86_64, macos-x86_64, ubuntu-latest] + + runs-on: ${{ matrix.os }} + if: "!contains(github.event.head_commit.message, 'ci skip')" + + steps: + - name: Get current date as package key + id: cache_key + run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT + + - name: Checkout repository + uses: actions/checkout@v6 + + # Force xmake to a specific folder (for cache) + - name: Set xmake env + run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV + + # Install xmake + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }} + + # Update xmake repository (in order to have the file that will be cached) + - name: Update xmake repository + run: xmake repo --update + + # Build the mlx + - name: Build MacroLibX + run: xmake --yes diff --git a/.gitea/workflows/linux.yml b/.gitea/workflows/linux.yml deleted file mode 100644 index d4742d3..0000000 --- a/.gitea/workflows/linux.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Linux - -on: - repository_dispatch: - types: [create-pull-request] - pull_request: - push: - paths-ignore: - - '.gitignore' - - 'LICENSE' - - 'README.md' - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - arch: [x86_64] - - runs-on: ${{ matrix.os }} - if: "!contains(github.event.head_commit.message, 'ci skip')" - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get -y install mesa-common-dev clang libsdl2-2.0-0 libsdl2-dev build-essential libvulkan-dev - - - name: Build - run: cd sandbox && make diff --git a/.gitea/workflows/macos.yml b/.gitea/workflows/macos.yml deleted file mode 100644 index 61acdb2..0000000 --- a/.gitea/workflows/macos.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: MacOS - -on: - repository_dispatch: - types: [create-pull-request] - pull_request: - push: - paths-ignore: - - '.gitignore' - - 'LICENSE' - - 'README.md' - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [macos-x86_64] - - runs-on: ${{ matrix.os }} - if: "!contains(github.event.head_commit.message, 'ci skip')" - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Install system dependencies - run: brew install SDL2 vulkan-headers - - - name: Build - run: cd sandbox && make diff --git a/.gitignore b/.gitignore index 41b2f02..abcc61f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.swp *.swx sandbox/test +sandbox/build/ +sandbox/.xmake/ diff --git a/sandbox/Makefile b/sandbox/Makefile deleted file mode 100644 index a8786bb..0000000 --- a/sandbox/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -NAME = ./test - -CC = clang - -all : $(NAME) - -$(NAME): - $(CC) -o $(NAME) main.c -lvulkan -lSDL2 -g - -.PHONY: all diff --git a/sandbox/xmake.lua b/sandbox/xmake.lua new file mode 100644 index 0000000..b49199e --- /dev/null +++ b/sandbox/xmake.lua @@ -0,0 +1,11 @@ +add_requires("libsdl2", { configs = { sdlmain = false } }) +add_requires("vulkan-headers") + +target("test") + set_kind("binary") + add_linkdirs("./") + add_files("main.c", { languages = "c99" }) + add_defines("SDL_MAIN_HANDLED") + add_packages("libsdl2", "vulkan-headers") + add_syslinks("vulkan") +target_end()