From eff21ee2ce1fdb4328d71d801352ec25f4e457ff Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 2 Apr 2025 18:49:15 +0800 Subject: feat: ftxui (#17) * ready for merge rm sum random ocmments first and https://github.com/ArthurSonzogni/FTXUI/issues/1024 but still, ready for merge since we can't do anything on our end * style: clang-tidy * ci * ci * style: clang-tidy * fix * fix: scroll https://github.com/ArthurSonzogni/git-tui/blob/master/src/scroller.cpp * focus * update todo * style: clang-format * update todo * sticky scroll * update todxo * smol fix need event to update screen. so we just give event when IO updates * style: clang-format --------- Co-authored-by: github-actions[bot] --- .github/workflows/ci.yml | 82 ++++++++++++++++++++++----------------- .github/workflows/release-tip.yml | 30 +++++++------- 2 files changed, 60 insertions(+), 52 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a30df9b..7cb54ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,12 @@ jobs: - name: Install dependencies run: | pacman -Syu --noconfirm - pacman -S --noconfirm base-devel git make ninja gcc clang + pacman -S --noconfirm base-devel git make ninja gcc clang cmake + git clone https://github.com/ArthurSonzogni/FTXUI.git + cd FTXUI + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build + cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` + cmake --install build - name: Checkout repository uses: actions/checkout@v4 @@ -49,39 +54,39 @@ jobs: name: chat-server-linux path: build/chat-server - macos: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork - name: "Build (macOS)" - runs-on: macos-latest - steps: - - name: Install dependencies - run: | - brew update - brew install llvm@14 gcc@14 make ninja - - name: Install compiler - id: install_cc - uses: rlalik/setup-cpp-compiler@master - with: - compiler: gcc-14 - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - name: Build project - env: - # CC: ${{ steps.install_cc.outputs.cc }} - # CXX: ${{ steps.install_cc.outputs.cxx }} - # above don't work cuz for some reason it's using g++ from /usr/local/bin :/ - CC: /opt/homebrew/bin/g++-14 - CXX: /opt/homebrew/bin/g++-14 - run: make all - - name: Upload Artifact - if: success() - uses: actions/upload-artifact@v4 - with: - name: chat-server-macos - path: build/chat-server + # macos: + # if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork + # name: "Build (macOS)" + # runs-on: macos-latest + # steps: + # - name: Install dependencies + # run: | + # brew update + # brew install llvm@14 gcc@14 make ninja + # - name: Install compiler + # id: install_cc + # uses: rlalik/setup-cpp-compiler@master + # with: + # compiler: gcc-14 + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.head_ref }} + # fetch-depth: 0 + # - name: Build project + # env: + # # CC: ${{ steps.install_cc.outputs.cc }} + # # CXX: ${{ steps.install_cc.outputs.cxx }} + # # above don't work cuz for some reason it's using g++ from /usr/local/bin :/ + # CC: /opt/homebrew/bin/g++-14 + # CXX: /opt/homebrew/bin/g++-14 + # run: make all + # - name: Upload Artifact + # if: success() + # uses: actions/upload-artifact@v4 + # with: + # name: chat-server-macos + # path: build/chat-server clang-linux: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork @@ -93,7 +98,12 @@ jobs: - name: Install dependencies run: | pacman -Syu --noconfirm - pacman -S --noconfirm base-devel git make ninja clang llvm + pacman -S --noconfirm base-devel git make ninja clang llvm cmake + git clone https://github.com/ArthurSonzogni/FTXUI.git + cd FTXUI + cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build + cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` + cmake --install build - name: Checkout repository uses: actions/checkout@v4 @@ -104,7 +114,7 @@ jobs: - name: Build project run: | - CXX=clang++ make all + CXX=clang++ CC=clang++ make all clang-format: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork diff --git a/.github/workflows/release-tip.yml b/.github/workflows/release-tip.yml index 22e01ed..6283e7c 100644 --- a/.github/workflows/release-tip.yml +++ b/.github/workflows/release-tip.yml @@ -48,13 +48,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - - name: Download macOS Build Artifact - uses: actions/download-artifact@v4 - with: - name: chat-server-macos - path: artifacts/macos/ - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} + # - name: Download macOS Build Artifact + # uses: actions/download-artifact@v4 + # with: + # name: chat-server-macos + # path: artifacts/macos/ + # github-token: ${{ secrets.GITHUB_TOKEN }} + # run-id: ${{ github.event.workflow_run.id }} - name: Create Source Archive run: | @@ -72,13 +72,13 @@ jobs: cd ../.. sha256sum chat-server-linux-x86_64.tar.gz > chat-server-linux-x86_64.tar.gz.sha256 - - name: Prepare macOS Binary Archive - run: | - cd artifacts/macos - chmod +x chat-server - tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f ../../chat-server-macos-x86_64.tar.gz * - cd ../.. - sha256sum chat-server-macos-x86_64.tar.gz > chat-server-macos-x86_64.tar.gz.sha256 + # - name: Prepare macOS Binary Archive + # run: | + # cd artifacts/macos + # chmod +x chat-server + # tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f ../../chat-server-macos-x86_64.tar.gz * + # cd ../.. + # sha256sum chat-server-macos-x86_64.tar.gz > chat-server-macos-x86_64.tar.gz.sha256 - name: Release uses: softprops/action-gh-release@v2 @@ -92,7 +92,5 @@ jobs: chat-server-source.tar.gz.sha256 chat-server-linux-x86_64.tar.gz chat-server-linux-x86_64.tar.gz.sha256 - chat-server-macos-x86_64.tar.gz - chat-server-macos-x86_64.tar.gz.sha256 token: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3