Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/api_docs_gen.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 4 additions & 4 deletions .github/workflows/app_builder.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/demo_builder.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand All @@ -25,7 +25,7 @@ on:
default: ${{ github.repository }}
conan_version:
type: string
default: "2.10.1"
default: "2.16.1"
version:
type: string
default: ""
Expand All @@ -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}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_all.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand All @@ -30,7 +30,7 @@ on:
default: ""
conan_version:
type: string
default: "2.10.1"
default: "2.16.1"

jobs:
linux_x86_64_clang:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_linux.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand All @@ -25,7 +25,7 @@ on:
default: ${{ github.repository }}
conan_version:
type: string
default: "2.10.1"
default: "2.16.1"
version:
type: string
default: ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library_check.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -40,7 +40,7 @@ on:
default: ${{ github.repository }}
conan_version:
type: string
default: "2.10.1"
default: "2.16.1"

jobs:
tests:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/self_check.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,6 +21,7 @@ on:
- main
schedule:
- cron: "0 12 * * 0"
workflow_dispatch:

jobs:
libhal:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/take.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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/

Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down
36 changes: 23 additions & 13 deletions scripts/api.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions scripts/api_py_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sphinx
sphinx-rtd-theme
mkdocs-material
mkdocs-literate-nav
mkdoxy
pydata-sphinx-theme
myst_parser
mike
breathe
Loading