Skip to content
Open
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
15 changes: 15 additions & 0 deletions .github/actions/configure_conan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Setup conan enviorrnement'
description: 'Compile and run unit tests'


runs:
using: "composite"
steps:
- name: "Setup Conan Client"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this dependency when we could also just use pipx install conan? Its the same number of lines but then we just have to worry about pipx for Conan working and not yet another github action which may, at some point stop getting updates. If that happens, which has happened to me in the past, it's a maintenance burden to update all of that. Especially if each repo is getting its own action.

uses: conan-io/setup-conan@v1

- name: "Configure Conan to use libhal's artifactory"
shell: bash
run: |
conan config install https://github.com/libhal/conan-config2.git
conan hal setup
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ✅ CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
lint:
uses: libhal/ci/.github/workflows/lint.yml@main
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use main, use 5.x.y if you want the latest without breaking changes.

with:
library: scatter_span
source_dir: .
repo: libhal/scatter_span

ci:
strategy:
matrix:
# TODO: Add second matrix dimension for compilers once GCC supports modules
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every TODO needs an issue number. We must have some sort of non-code tracking for these.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing the arm architectures as well.

include:
- os: ubuntu-latest
os_name: linux
- os: macos-latest
os_name: mac
- os: windows-latest
os_name: windows

runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Conan
uses: ./.github/actions/configure_conan

- name: Build and Test
shell: bash
run: conan build . -pr:a hal/tc/llvm -pr hal/os/${{ matrix.os_name }}

2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def validate(self):
def build_requirements(self):
self.tool_requires("cmake/[^4.0.0]")
self.tool_requires("ninja/[^1.3.0]")
self.tool_requires("llvm-toolchain/[^19.0]")
self.tool_requires("llvm-toolchain/[^20.0]")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This MUST NOT be in the Conan file. This prevents the usage of GCC. And you cannot depend on both GCC or LLVM. You could with some if statements but then one would need that for every possible toolchain. You may say, "well why bother, if these are the only two"

Three reason

  1. Maintainance burden the moment when that is no longer the case. Wed have to go through every single repo to add the new compiler. We can skip that by letting the profile handle it.
  2. Constrains the package to a particular version. We don't want nor need that here. We can do that in the validation area.
  3. Makes it harder for devs to use their own versions of these toolchains LLVM or GCC if this info is embedded directly in.

Overall, the package should be agnostic to the toolchain package used to build it.

self.test_requires("boost-ext-ut/2.3.1")
self.tool_requires("libhal-cmake-util/[^5.0.5]")

Expand Down
Loading