Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MaliaLabor authored Aug 9, 2024
0 parents commit 48c0209
Show file tree
Hide file tree
Showing 31 changed files with 1,393 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BasedOnStyle: Mozilla
Language: Cpp
UseTab: Never
AlwaysBreakAfterReturnType: None
AlwaysBreakAfterDefinitionReturnType: None
AllowShortFunctionsOnASingleLine: None
FixNamespaceComments: true
SpacesBeforeTrailingComments: 2
ColumnLimit: 80
QualifierAlignment: Right
8 changes: 8 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
If:
PathMatch: demos/.*
CompileFlags:
CompilationDatabase: demos
Else:
CompileFlags:
CompilationDatabase: .

78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2024 Khalil Estell
#
# 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: ✅ CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 12 * * 0"

jobs:
ci:
uses: libhal/ci/.github/workflows/[email protected]
secrets: inherit

deploy_all_check:
uses: libhal/ci/.github/workflows/[email protected]
secrets: inherit

demo_check_lpc4074:
uses: libhal/ci/.github/workflows/[email protected]
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-arm-mcu.git
platform_profile: v1/lpc4074
secrets: inherit

demo_check_lpc4078:
uses: libhal/ci/.github/workflows/[email protected]
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-arm-mcu.git
platform_profile: v1/lpc4078
secrets: inherit

demo_check_stm32f103c8:
uses: libhal/ci/.github/workflows/[email protected]
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-arm-mcu.git
platform_profile: v1/stm32f103c8
secrets: inherit

demo_check_mod-stm32f1-v4:
uses: libhal/ci/.github/workflows/[email protected]
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-micromod.git
platform_profile: v1/mod-stm32f1-v4
secrets: inherit

demo_check_mod-lpc40-v5:
uses: libhal/ci/.github/workflows/[email protected]
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-micromod.git
platform_profile: v1/mod-lpc40-v5
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 🚀 Deploy

on:
workflow_dispatch:

jobs:
deploy:
if: startsWith(github.ref, 'refs/tags/')
uses: libhal/ci/.github/workflows/[email protected]
with:
version: ${{ github.ref_name }}
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/take.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2024 Khalil Estell
#
# 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.

# .github/workflows/take.yml
name: 📛 assign issue to contributor
on:
issue_comment:

jobs:
assign:
name: Take an issue
runs-on: ubuntu-latest
steps:
- name: take the issue
uses: bdougie/take-action@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
message: Thanks for taking this issue! Let us know if you have any questions!
57 changes: 57 additions & 0 deletions .github/workflows/update_name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2024 Khalil Estell
#
# 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: 🖋️ Update package name

on:
workflow_dispatch:
push:
branches:
- main

jobs:
update_name:
name: 🖋️ Update package name
runs-on: ubuntu-latest
if: github.repository != 'libhal/libhal-__device__'
steps:
- uses: actions/checkout@v2
with:
submodules: true

- run: sudo apt install rename

- name: Get device name from repo name
id: device_name
run: echo ${{ github.event.repository.name }} | sed -En "s/libhal-(.*)/device_name=\1/p" >> $GITHUB_ENV

- name: Replace placeholder's in files
run: find . -type f -not -path '*/\.git/*' -exec sed -i "s/__device__/${{ env.device_name }}/g" {} +

- name: Replace "// NOLINT" in files
run: find . -type f -not -path '*/\.git/*' -exec sed -i "s/[ ]*\/\/ NOLINT//g" {} +

- name: Replace placeholder's in directory names
run: find . -type d -not -path '*/\.git/*' | xargs -r rename "s/__device__/${{ env.device_name }}/g"

- name: Replace placeholder's in file names
run: find . -type f -not -path '*/\.git/*' | xargs -r rename "s/__device__/${{ env.device_name }}/g"

- name: Remove update_name.yml file
run: rm .github/workflows/update_name.yml

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: "Rename device package to libhal-${{ env.device_name }}"
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# IDEs
.vscode/
archives/

# GDB
.gdb_history

# Artifacts
build/
tools/

# lint artifacts
compile_commands.json
.cache/

# OS files
.DS_Store

# Conan Files
graph_info.json
conaninfo.txt
conan.lock
conanbuildinfo.txt

# CMake
CMakeUserPresets.json

Loading

0 comments on commit 48c0209

Please sign in to comment.