From 127efe3d07ab28f8571def61d88879e4d0d7a6dd Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Thu, 1 May 2025 05:01:31 -0700 Subject: [PATCH 1/5] :construction_worker: Removing macOS 13 from tests (#68) For some reason, `std::pmr::memory_resource` does not link on macOS 13. Rather than try to support an older version of mac, I am removing macOS 13 from the tests. We may bring back support and investigate fixing the pmr issue if there is demand for it. --- .github/workflows/tests.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index de21626..a69a7d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,9 +51,6 @@ jobs: - os: ubuntu-24.04 profile_path: profiles/x86_64/linux/ - - os: macos-13 - profile_path: profiles/x86_64/mac-13/ - - os: macos-14 profile_path: profiles/x86_64/mac-14/ @@ -108,15 +105,6 @@ jobs: pipx ensurepath sudo apt install clang-tidy-17 - - name: 📥 Install OS Specific Tools (macos-13) - if: ${{ matrix.os == 'macos-13' }} - run: | - brew install llvm@17 - ls $(brew --prefix llvm@17)/bin - ln -s $(brew --prefix llvm@17)/bin/clang-tidy /usr/local/bin/ - brew install pipx - pipx ensurepath - - name: 📥 Install OS Specific Tools (macos-14) if: ${{ matrix.os == 'macos-14' }} run: | From b85fcf1faa1157ed1784a19d0508ecfeda46ed51 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Tue, 27 May 2025 06:29:04 -0700 Subject: [PATCH 2/5] :zap: Remove clang-11-dev install in lint (#73) * :arrow_up: conan/2.16.1 * :zap: Remove clang-11-dev install in lint --- .github/workflows/app_builder.yml | 6 +++--- .github/workflows/demo_builder.yml | 6 +++--- .github/workflows/deploy.yml | 4 ++-- .github/workflows/deploy_all.yml | 4 ++-- .github/workflows/deploy_linux.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/library_check.yml | 4 ++-- .github/workflows/lint.yml | 6 +----- .github/workflows/self_check.yml | 2 +- .github/workflows/take.yml | 2 +- .github/workflows/tests.yml | 4 ++-- scripts/api.py | 2 +- 12 files changed, 21 insertions(+), 25 deletions(-) diff --git a/.github/workflows/app_builder.yml b/.github/workflows/app_builder.yml index f339617..f80a395 100644 --- a/.github/workflows/app_builder.yml +++ b/.github/workflows/app_builder.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ on: default: "" conan_version: type: string - default: "2.10.1" + default: "2.16.1" compiler_profile_url: type: string required: true @@ -66,7 +66,7 @@ jobs: repository: ${{ inputs.repo }} - name: 📥 Install Conan ${{ inputs.conan_version }} - run: pip3 install conan==${{ inputs.conan_version }} + run: pipx install conan==${{ inputs.conan_version }} - name: 📡 Add `libhal` repo to conan remotes run: conan remote add libhal diff --git a/.github/workflows/demo_builder.yml b/.github/workflows/demo_builder.yml index 8341e87..de4e272 100644 --- a/.github/workflows/demo_builder.yml +++ b/.github/workflows/demo_builder.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ on: default: "" conan_version: type: string - default: "2.10.1" + default: "2.16.1" compiler_profile_url: type: string required: true @@ -66,7 +66,7 @@ jobs: repository: ${{ inputs.repo }} - name: 📥 Install Conan ${{ inputs.conan_version }} - run: pip3 install conan==${{ inputs.conan_version }} + run: pipx install conan==${{ inputs.conan_version }} - name: 📡 Add `libhal` repo to conan remotes run: conan remote add libhal diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f8493ba..edd0342 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ on: default: ${{ github.repository }} conan_version: type: string - default: "2.10.1" + default: "2.16.1" version: type: string default: "" diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 4855dc2..e1c07e1 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ on: default: "" conan_version: type: string - default: "2.10.1" + default: "2.16.1" jobs: linux_x86_64_clang: diff --git a/.github/workflows/deploy_linux.yml b/.github/workflows/deploy_linux.yml index bfd03cc..f6503bb 100644 --- a/.github/workflows/deploy_linux.yml +++ b/.github/workflows/deploy_linux.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ on: default: ${{ github.repository }} conan_version: type: string - default: "2.10.1" + default: "2.16.1" version: type: string default: "" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 91205e9..dedd8f1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/library_check.yml b/.github/workflows/library_check.yml index 72d01bd..7713265 100644 --- a/.github/workflows/library_check.yml +++ b/.github/workflows/library_check.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ on: default: ${{ github.repository }} conan_version: type: string - default: "2.10.1" + default: "2.16.1" jobs: tests: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3fdb119..f2d157a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,10 +47,6 @@ jobs: submodules: true repository: ${{ inputs.repo }} - - name: 📥 Install libclang-11-dev (for name style check) - shell: bash - run: sudo apt install libclang-11-dev - - name: 🌐 Downloading .clang-format from libhal run: wget https://raw.githubusercontent.com/libhal/libhal/main/.clang-format -O .clang-format diff --git a/.github/workflows/self_check.yml b/.github/workflows/self_check.yml index 1efb61c..c6009f8 100644 --- a/.github/workflows/self_check.yml +++ b/.github/workflows/self_check.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/take.yml b/.github/workflows/take.yml index 6fc6f46..6c3f951 100644 --- a/.github/workflows/take.yml +++ b/.github/workflows/take.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a69a7d6..4cbaed7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -177,7 +177,7 @@ jobs: # - name: 📥 Install gcovr # if: ${{ matrix.enable_coverage }} - # run: pip3 install gcovr + # run: pipx install gcovr # - name: 🔎 Generate Code Coverage # if: ${{ matrix.enable_coverage }} diff --git a/scripts/api.py b/scripts/api.py index d9ba9fb..42d8a24 100644 --- a/scripts/api.py +++ b/scripts/api.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2024 Khalil Estell +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From b2e38e913eb931fa86bd6d1a4fd196504645d576 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Tue, 27 May 2025 11:00:35 -0700 Subject: [PATCH 3/5] :technologist: env:VERBOSE=1 in deploy.yml (#75) With this, we will now be able to see VERBOSE output from the conan build allowing us to find problems in the build such as missing command arguments. --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index edd0342..49e3b08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,6 +51,8 @@ on: jobs: deploy: runs-on: ubuntu-24.04 + env: + VERBOSE: 1 steps: - uses: actions/checkout@v4.1.1 if: ${{ inputs.version != '' && inputs.external_package == false}} From 038bf161050e4fc2d16b506878222f61e573a4a6 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Tue, 27 May 2025 16:20:40 -0700 Subject: [PATCH 4/5] :construction_worker: Add workflow_dispatch to self_check (#77) --- .github/workflows/self_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/self_check.yml b/.github/workflows/self_check.yml index c6009f8..7fa7dff 100644 --- a/.github/workflows/self_check.yml +++ b/.github/workflows/self_check.yml @@ -21,6 +21,7 @@ on: - main schedule: - cron: "0 12 * * 0" + workflow_dispatch: jobs: libhal: From b54937995bff0469d215725ac030bf9ff9cc30b3 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Wed, 28 May 2025 08:10:18 -0700 Subject: [PATCH 5/5] :sparkles: Add `api_docs_gen.yml` (#79) Provides a generic and easy to use action for generating and deploy api docs to the `api` repo. Resolves #70 --- .github/workflows/api_docs_gen.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/app_builder.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/deploy_all.yml | 2 +- .github/workflows/deploy_linux.yml | 2 +- README.md | 4 ++-- scripts/api.py | 34 ++++++++++++++++++---------- scripts/api_py_requirements.txt | 9 ++++++++ 8 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/api_docs_gen.yml create mode 100644 scripts/api_py_requirements.txt diff --git a/.github/workflows/api_docs_gen.yml b/.github/workflows/api_docs_gen.yml new file mode 100644 index 0000000..ca7cdcb --- /dev/null +++ b/.github/workflows/api_docs_gen.yml @@ -0,0 +1,36 @@ +# Copyright 2024 - 2025 Khalil Estell and the libhal contributors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 📚 Generate APIs Docs + +on: + workflow_call: + +jobs: + generate_api_docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: sudo apt update + - run: sudo apt install -y doxygen + - run: wget https://raw.githubusercontent.com/libhal/ci/5.x.y/scripts/api.py + - run: wget https://raw.githubusercontent.com/libhal/ci/5.x.y/scripts/api_py_requirements.txt + - run: pip install -r docs/requirements.txt gitpython requests + - run: python api.py build --version ${{ github.ref_name }} + - run: python api.py deploy --version ${{ github.ref_name }} --repo-name ${{ github.event.repository.name }} + env: + GITHUB_TOKEN: ${{ secrets.API_PUSH_TOKEN }} diff --git a/.github/workflows/app_builder.yml b/.github/workflows/app_builder.yml index f80a395..24fa1ee 100644 --- a/.github/workflows/app_builder.yml +++ b/.github/workflows/app_builder.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 🏗️ Demo Builder +name: 🏗️ App Builder on: workflow_call: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 49e3b08..4d6e063 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Package 📦 + 🚀 Deploy +name: 📦🚀 Package & Deploy on: workflow_call: diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index e1c07e1..2a76493 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 🌐 Package 📦 + 🚀 Deploy 🌐 +name: Deploy ALL # Builds packages for every device and architecture libhal supports diff --git a/.github/workflows/deploy_linux.yml b/.github/workflows/deploy_linux.yml index f6503bb..4d70851 100644 --- a/.github/workflows/deploy_linux.yml +++ b/.github/workflows/deploy_linux.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Package 📦 + 🚀 Deploy +name: Deploy Linux on: workflow_call: diff --git a/README.md b/README.md index 9c7777d..0c8bf02 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,8 @@ jobs: with: compiler_profile_url: https://github.com/libhal/arm-gnu-toolchain.git compiler_profile: v1/arm-gcc-12.3 - platform_profile_url: https://github.com/libhal/libhal-lpc40.git - platform_profile: v2/lpc4078 + platform_profile_url: https://github.com/libhal/libhal-arm-mcu.git + platform_profile: v1/lpc4078 secrets: inherit ``` diff --git a/scripts/api.py b/scripts/api.py index 42d8a24..fa5c069 100644 --- a/scripts/api.py +++ b/scripts/api.py @@ -258,9 +258,9 @@ def create_pr_to_api_repo( print(f"Cloning {api_repo_url} into temporary directory...") api_repo = Repo.clone_from(api_repo_url, temp_dir) - # Create a new branch - print(f"Creating new branch: {branch_name}") - api_repo.git.checkout('-b', branch_name) + # Checkout existing branch or create a new branch + print(f"Switching to branch: {branch_name}") + api_repo.git.switch('-c', branch_name) # Create repo directory if it doesn't exist repo_dir = os.path.join(temp_dir, repo_name) @@ -379,21 +379,31 @@ def main(): # Build command build_parser = subparsers.add_parser("build", help="Build documentation") - build_parser.add_argument( - "--version", required=True, help="Version tag (e.g. 1.2.3)") - build_parser.add_argument( - "--output-dir", default="build/api/", help="Output directory") + build_parser.add_argument("--version", + required=True, + help="Version tag (e.g. 1.2.3)") + build_parser.add_argument("--output-dir", + default="build/api/", + help="Output directory") # Deploy command deploy_parser = subparsers.add_parser( - "deploy", help="Deploy documentation to API repo") + "deploy", + help="Deploy documentation to API repo") deploy_parser.add_argument( - "--version", required=True, help="Version tag (e.g. 1.2.3)") + "--version", + required=True, + help="Version tag (e.g. 1.2.3)") deploy_parser.add_argument( - "--repo-name", required=True, help="Repository name (e.g. libhal-arm)") + "--repo-name", + required=True, + help="Repository name (e.g. libhal-arm)") deploy_parser.add_argument( - "--docs-dir", default="build/api/", help="Directory containing built docs") - deploy_parser.add_argument("--api-repo", default="https://github.com/libhal/api.git", + "--docs-dir", + default="build/api/", + help="Directory containing built docs") + deploy_parser.add_argument("--api-repo", + default="https://github.com/libhal/api.git", help="URL of the API documentation repository") deploy_parser.add_argument("--organization", default="libhal", help="GitHub organization name") diff --git a/scripts/api_py_requirements.txt b/scripts/api_py_requirements.txt new file mode 100644 index 0000000..dfba2b1 --- /dev/null +++ b/scripts/api_py_requirements.txt @@ -0,0 +1,9 @@ +sphinx +sphinx-rtd-theme +mkdocs-material +mkdocs-literate-nav +mkdoxy +pydata-sphinx-theme +myst_parser +mike +breathe