From 30304f1668451e6c4a8511b51b565c35534018da Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sun, 27 Apr 2025 11:29:28 +0200 Subject: [PATCH] Update workflow --- .bcr/presubmit.yml | 43 ++++++++++++++++++------------------ .bcr/source.template.json | 4 ++-- .github/workflows/build.yaml | 29 +++++++++++++++++++++--- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 8ca84f16..658def63 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -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' + diff --git a/.bcr/source.template.json b/.bcr/source.template.json index 20374716..c7078647 100644 --- a/.bcr/source.template.json +++ b/.bcr/source.template.json @@ -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/{OWNER}/{REPO}/releases/download/{TAG}/source.tar.gz", } diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b484d399..5ca73610 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,7 +12,7 @@ on: jobs: test_bazel: - name: "Test Bazel" + name: "${{ matrix.os }}/Bazel/${{ matrix.compiler }}" strategy: fail-fast: false matrix: @@ -44,7 +44,7 @@ jobs: run: bazel run tests test_cmake: - name: "Tests CMake" + name: "${{ matrix.os }}/CMake/${{ matrix.compiler }}" 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'