Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
💚 Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Khalil Estell authored and kammce committed Aug 10, 2023
1 parent ef073b6 commit 0c20d5e
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 274 deletions.
102 changes: 80 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,83 @@ on:
- cron: "0 12 * * 0"

jobs:
ci:
uses: libhal/ci/.github/workflows/library.yml@4.x.y
with:
coverage: true
secrets: inherit
deploy:
uses: libhal/ci/.github/workflows/deploy.yml@4.x.y
secrets: inherit
build_lpc4074:
uses: libhal/ci/.github/workflows/demo_builder.yml@4.x.y
with:
profile: lpc4078
processor_profile: https://github.com/libhal/libhal-armcortex.git
platform_profile: https://github.com/libhal/libhal-lpc40.git
secrets: inherit
build_lpc4078:
uses: libhal/ci/.github/workflows/demo_builder.yml@4.x.y
with:
profile: stm32f103c8
processor_profile: https://github.com/libhal/libhal-armcortex.git
platform_profile: https://github.com/libhal/libhal-stm32f1.git
secrets: inherit
pull:
runs-on: ubuntu-22.04
if: github.event.action == 'deleted'
steps:
- name: 📥 Install CMake + Conan
run: pip3 install cmake conan

- name: 📡 Add `libhal` repo to conan remotes
run: conan remote add libhal
https://libhal.jfrog.io/artifactory/api/conan/trunk-conan

- name: 📡 Create and setup default profile
run: conan profile detect --force

- name: 👁️‍🗨️ Show conan profile
run: conan profile show

- name: 📡 Install linux default profiles
run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git

- name: 📡 Sign into JFrog Artifactory
env:
API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }}
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }}
run: conan remote login -p $API_KEY libhal $JFROG_USER

- name: 🚮 Pulling package version ${{ github.event.release.tag_name }} from `libhal` repo
run: conan remove "libhal-freertos/${{ github.event.release.tag_name }}" --confirm -r=libhal

build_and_package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: 📥 Install CMake + Conan
run: pip3 install cmake conan

- name: 📡 Add `libhal` repo to conan remotes
run: conan remote add libhal
https://libhal.jfrog.io/artifactory/api/conan/trunk-conan

- name: 📡 Create and setup default profile
run: conan profile detect --force

- name: 👁️‍🗨️ Show conan profile
run: conan profile show

- name: 📡 Install linux default profiles
run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git

- name: 📡 Sign into JFrog Artifactory
if: ${{ github.ref == 'refs/heads/main' }}
env:
API_KEY: ${{ secrets.JFROG_LIBHAL_TRUNK_API_KEY }}
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_USER }}
run: conan remote login -p $API_KEY libhal $JFROG_USER

- name: Install libhal settings_user.yml
run: conan config install -sf profiles/baremetal https://github.com/libhal/conan-config.git

- name: Install host OS profiles
run: conan config install -sf profiles/x86_64/linux/ -tf profiles https://github.com/libhal/conan-config.git

- name: Install processor profiles
run: conan config install -tf profiles -sf conan/profiles/ https://github.com/libhal/libhal-armcortex.git

- name: Install platform profiles
run: conan config install -tf profiles -sf conan/profiles/ https://github.com/libhal/libhal-lpc40.git

- name: Install platform profiles
run: conan config install -tf profiles -sf conan/profiles/ https://github.com/libhal/libhal-stm32f1.git

- name: 📦 Create `MinSizeRel` package for lpc4078
run: conan create . --version=10.6.0 -pr lpc4078 -s build_type=MinSizeRel -b missing

- name: 📦 Create `MinSizeRel` package for stm32f103c8
run: conan create . --version=10.6.0 -pr stm32f103c8 -s build_type=MinSizeRel -b missing

- name: 🆙 Upload package version ${{ github.ref_name }} to `libhal` repo
if: startsWith(github.ref, 'refs/tags/')
run: conan upload --only-recipe "libhal-freertos/${{ github.ref_name }}" --confirm -r=libhal
File renamed without changes.
Binary file removed all/.DS_Store
Binary file not shown.
24 changes: 0 additions & 24 deletions all/test_package/CMakeLists.txt

This file was deleted.

37 changes: 0 additions & 37 deletions all/test_package/conanfile.py

This file was deleted.

115 changes: 0 additions & 115 deletions all/test_package/main.cpp

This file was deleted.

File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

cmake_minimum_required(VERSION 3.15)

project(test_package LANGUAGES CXX)

find_package(libhal-freertos REQUIRED CONFIG)

add_executable(${PROJECT_NAME} main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC .)
add_executable(${PROJECT_NAME} main.cpp newlib.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE ..)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_link_libraries(${PROJECT_NAME} PRIVATE libhal::freertos)
12 changes: 5 additions & 7 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
# limitations under the License.

from conan import ConanFile
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv"

def requirements(self):
def build_requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
Expand All @@ -34,6 +32,6 @@ def build(self):
cmake.build()

def test(self):
if not cross_building(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
# Executables generated by this toolchain will never work on a host
# machine and thus can never be executed.
pass
Loading

0 comments on commit 0c20d5e

Please sign in to comment.