Compare commits

...

6 Commits

Author SHA1 Message Date
Arthur Sonzogni
7ef651f7e9
Merge ee80e956dd into 07fd3e685a 2025-04-27 10:40:03 +00:00
ArthurSonzogni
ee80e956dd
Update workflow 2025-04-27 12:39:48 +02:00
ArthurSonzogni
aa6d1df1dd
Update workflow 2025-04-27 11:41:21 +02:00
ArthurSonzogni
cabb7cad91
Update workflow 2025-04-27 11:38:44 +02:00
ArthurSonzogni
a0d59acf62
Update workflow. 2025-04-27 11:32:19 +02:00
ArthurSonzogni
30304f1668
Update workflow 2025-04-27 11:29:28 +02:00
6 changed files with 84 additions and 46 deletions

View File

@ -1,25 +1,24 @@
# Copyright 2025 Arthur Sonzogni. All rights reserved.
# Use of this source code is governed by the MIT license that can be found in
# the LICENSE file.
bcr_test_module:
module_path: "."
matrix:
platform: [
"debian11",
"macos",
"macos-arm64",
"ubuntu2204",
"windows",
]
bazel: [
6.x,
7.x,
8.x,
]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
test_targets:
- "//..."
matrix:
platform:
- centos7
- debian10
- ubuntu2004
- macos
- windows
bazel: [6.x, 7.x, 8.x]
tasks:
verify_targets:
name: Build and test.
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@ftxui//:ftxui'
- '@ftxui//:screen'
- '@ftxui//:dom'
- '@ftxui//:component'
test_targets:
- '@ftxui//:tests'

View File

@ -1,5 +1,5 @@
{
"integrity": "",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
"strip_prefix": "",
"url": "https://github.com/ArthurSonzogni/FTXUI/releases/download/{TAG}/source.tar.gz"
}

View File

@ -12,7 +12,7 @@ on:
jobs:
test_bazel:
name: "Test Bazel"
name: "Bazel, ${{ matrix.compiler }}, ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
@ -44,7 +44,7 @@ jobs:
run: bazel run tests
test_cmake:
name: "Tests CMake"
name: "CMake, ${{ matrix.compiler }}, ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
@ -173,7 +173,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build artifact for the release
package:
package_compiled:
name: "Build packages"
needs: release
strategy:
@ -217,6 +217,29 @@ jobs:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.asset_path }}
overwrite: true
# Build "source" artifact for the release. This is the same as the github
# "source" archive, but with a stable URL. This is useful for the Bazel
# Central Repository.
package_source:
name: "Build source package"
needs: release
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Create source package"
run: >
git archive --format=tar.gz --prefix=ftxui/ -o source.tar.gz HEAD
- name: "Upload source package"
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: source.tar.gz
overwrite: true
documentation:
if: github.ref == 'refs/heads/main'

View File

@ -1,12 +1,12 @@
on:
# Run the publish workflow after a successful release.
# On new releases:
workflow_call:
inputs:
tag_name:
required: true
type: string
# Allow manual triggering of the workflow.
# On manual trigger:
workflow_dispatch:
inputs:
tag_name:
@ -15,10 +15,9 @@ on:
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@[version]
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
with:
tag_name: ${{ inputs.tag_name }}
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
registry_fork: ArthurSonzogni/bazel-central-registry
permissions:
attestations: write

View File

@ -3,13 +3,9 @@
# the LICENSE file.
# TODO:
# - Windows/MSVC support.
# - Pass /utf-8 to MSVC users depending on FTXUI.
# - Pass "FTXUI_MICROSOFT_TERMINAL_FALLBACK" to windows users.
# - Support building benchmark.
# - Support building examples.
# - Support building fuzzer.
# - Support building documentation.
# - Build benchmark.
# - Build fuzzers.
# - Build documentation.
# - Enable the two tests timing out.
# - Support WebAssembly
@ -17,7 +13,7 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(":bazel/ftxui.bzl", "ftxui_cc_library")
load(":bazel/ftxui.bzl", "generate_examples")
load(":bazel/ftxui.bzl", "cpp20")
load(":bazel/ftxui.bzl", "msvc_copts")
load(":bazel/ftxui.bzl", "windows_copts")
load(":bazel/ftxui.bzl", "pthread_linkopts")
package(default_visibility = ["//visibility:public"])
@ -245,7 +241,7 @@ cc_test(
"include",
"src",
],
copts = cpp20() + msvc_copts(),
copts = cpp20() + windows_copts(),
deps = [
"//:ftxui",
"@googletest//:gtest_main",

View File

@ -20,23 +20,42 @@ def cpp20():
"//conditions:default": ["-std=c++20"],
})
def msvc_copts():
# Microsoft terminal is a bit buggy ¯\_(ツ)_/¯ and MSVC uses bad defaults.
def windows_copts():
MSVC_COPTS = [
# Force Microsoft Visual Studio to decode sources files in UTF-8.
# Microsoft Visual Studio must decode sources files as UTF-8.
"/utf-8",
# Force Microsoft Visual Studio to interpret the source files as
# Unicode.
# Microsoft Visual Studio must interpret the codepoint using unicode.
"/DUNICODE",
"/D_UNICODE",
# Fallback for Microsoft Terminal.
# This
# - Replace missing font symbols by others.
# - Reduce screen position pooling frequency to deals against a Microsoft
# race condition. This was fixed in 2020, but clients never not updated.
# - https://github.com/microsoft/terminal/pull/7583
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
"/DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
]
WINDOWS_COPTS = [
# Fallback for Microsoft Terminal.
# This
# - Replace missing font symbols by others.
# - Reduce screen position pooling frequency to deals against a Microsoft
# race condition. This was fixed in 2020, but clients never not updated.
# - https://github.com/microsoft/terminal/pull/7583
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
"-DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
];
return select({
# MSVC:
"@rules_cc//cc/compiler:msvc-cl": MSVC_COPTS,
"@rules_cc//cc/compiler:clang-cl": MSVC_COPTS,
"@platforms//os:windows": WINDOWS_COPTS,
"//conditions:default": [],
})
@ -69,10 +88,12 @@ def ftxui_cc_library(
"include",
"src",
],
copts = cpp17() + msvc_copts(),
copts = cpp17() + windows_copts(),
visibility = ["//visibility:public"],
)
# Compile all the examples in the examples/ directory.
# This is useful to check the Bazel is synchronized with CMake definitions.
def generate_examples():
cpp_files = native.glob(["examples/**/*.cpp"])
@ -90,5 +111,5 @@ def generate_examples():
name = name,
srcs = [src],
deps = ["//:component"],
copts = cpp20() + msvc_copts(),
copts = cpp20() + windows_copts(),
)