Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with criticalup in CI #7

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
92 changes: 92 additions & 0 deletions .github/workflows/build-ferrocene.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright (c) 2023 Ferrous Systems
# SPDX-License-Identifier: MIT OR Apache-2.0

name: workflow-build-everything-ferrocene
run-name: Build Everything with Ferrocene
on: [push]
jobs:
job-build-threadx-staticlib:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install tools
run: |
sudo apt-get update -y && sudo apt-get -y install cmake gcc gcc-arm-none-eabi build-essential ninja-build
- name: Compile ThreadX for Cortex-M4
run: |
cd threadx
cmake -Bbuild_m4 -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake
cmake --build ./build_m4
- name: Upload staticlib
uses: actions/upload-artifact@master
with:
name: threadx-cm4
path: threadx/build_m4/libthreadx.a
job-build-demo-app:
runs-on: ubuntu-latest
needs: job-build-threadx-staticlib
steps:
- name: Install Arm C compiler
run: |
sudo apt-get update -y && sudo apt-get -y install gcc-arm-none-eabi
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.0.0-prerelease.1/criticalup-installer.sh | sh
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Download staticlib
uses: actions/download-artifact@master
with:
name: threadx-cm4
path: threadx/build # Where build.rs expects it
- name: Install Ferrocene
env: # Or as an environment variable
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }}
run: |
echo ${CRITICALUP_TOKEN} | criticalup auth set
jonathanpallant marked this conversation as resolved.
Show resolved Hide resolved
criticalup install
echo "$HOME/.local/share/criticalup/bin" >> $GITHUB_PATH
- name: Find slug name
run: |
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "BUILD_SLUG=${slug}" >> "${GITHUB_ENV}"
- name: Check Demo App
run: |
cd demo-app
rustc --version
cargo --version
cargo check --target=thumbv7em-none-eabi
- name: Build Demo App
run: |
cd demo-app
rustc --version
cargo --version
cargo build --target=thumbv7em-none-eabi --release
- name: Upload demo-app
uses: actions/upload-artifact@master
with:
name: demo-app
path: demo-app/target/thumbv7em-none-eabi/release/demo-app
job-build-threadx-sys:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Check threadx-sys
run: |
cd threadx-sys
cargo check
- name: Build threadx-sys
run: |
cd threadx-sys
cargo build
19 changes: 19 additions & 0 deletions criticalup.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2024 Ferrous Systems
# SPDX-License-Identifier: MIT OR Apache-2.0

manifest-version = 1

[products.ferrocene]
release = "pre-rolling-2024-05-24"
packages = [
"rustc-${rustc-host}",
"rust-std-${rustc-host}",
"cargo-${rustc-host}",
"clippy-${rustc-host}",
"rustfmt-${rustc-host}",
"rust-analyzer-${rustc-host}",
"ferrocene-self-test-${rustc-host}",
"flip-link-${rustc-host}",
"llvm-tools-${rustc-host}",
"rust-std-thumbv7em-none-eabi",
]