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 f339617..24fa1ee 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. @@ -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: @@ -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..4d6e063 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. @@ -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: @@ -25,7 +25,7 @@ on: default: ${{ github.repository }} conan_version: type: string - default: "2.10.1" + default: "2.16.1" version: type: string default: "" @@ -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}} diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 4855dc2..2a76493 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. @@ -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 @@ -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..4d70851 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. @@ -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: @@ -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..7fa7dff 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. @@ -21,6 +21,7 @@ on: - main schedule: - cron: "0 12 * * 0" + workflow_dispatch: jobs: libhal: 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 de21626..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. @@ -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: | @@ -189,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/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 d9ba9fb..fa5c069 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. @@ -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