Skip to content

Commit b8e46b4

Browse files
authored
Merge pull request #546 from tock/ci-support-range
ci: Explicitly build for oldest and newest compliers
2 parents afd47f7 + 16b1640 commit b8e46b4

File tree

3 files changed

+50
-10
lines changed

3 files changed

+50
-10
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,73 @@ jobs:
1313
ci-format:
1414
strategy:
1515
matrix:
16-
os: [ubuntu-22.04]
16+
os: [ubuntu-latest]
1717
# The type of runner that the job will run on
1818
runs-on: ${{ matrix.os }}
1919

2020
# Steps represent a sequence of tasks that will be executed as part of the job
2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
with:
2424
submodules: false # LVGL makefile manually installs the submodule
25+
show-progress: false
2526
- name: Disable wget progress output
2627
run: |
2728
echo "verbose = off" >> $HOME/.wgetrc
2829
- name: ci-format
2930
run: pushd examples; ./format_all.sh || exit; popd
3031

3132
ci-build:
33+
# Build on the newest-available OS with newest-available compilers and with
34+
# default compiler versions from the oldest current Ubuntu LTS
3235
strategy:
3336
matrix:
34-
os: [ubuntu-22.04]
35-
# The type of runner that the job will run on
37+
os: [ubuntu-latest, ubuntu-22.04]
3638
runs-on: ${{ matrix.os }}
3739

38-
# Steps represent a sequence of tasks that will be executed as part of the job
3940
steps:
40-
- uses: actions/checkout@v2
41+
###########################################
42+
# Install toolchains for ubuntu-latest
43+
- name: Install ARM toolchain (ubuntu latest)
44+
if: ${{ matrix.os == 'ubuntu-latest' }}
45+
uses: carlosperate/arm-none-eabi-gcc-action@v1
46+
with:
47+
release: 'latest'
48+
- name: Install RISC-V toolchain (ubuntu latest)
49+
if: ${{ matrix.os == 'ubuntu-latest' }}
50+
# Install latest RISC-V toolchains, uses xPack
51+
# https://xpack-dev-tools.github.io/
52+
run: |
53+
npm install --location=global xpm@latest
54+
xpm install --global @xpack-dev-tools/riscv-none-elf-gcc@latest
55+
tree -a "$HOME/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/" || echo "nope"
56+
echo "$HOME/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/14.2.0-3.1/.content/bin" >> "$GITHUB_PATH"
57+
58+
###########################################
59+
# Install toolchains for ubuntu LTS
60+
# Use apt to ensure we are matching 'out of the box' LTS
61+
- name: Install Toolchains
62+
if: ${{ matrix.os == 'ubuntu-22.04' }}
63+
run: sudo apt-get install -y gcc-arm-none-eabi gcc-riscv64-unknown-elf
64+
65+
###########################################
66+
# Report what toolchains are installed
67+
- name: report-toolchain-versions
68+
run: |
69+
arm-none-eabi-gcc --version
70+
riscv-none-elf-gcc --version || riscv64-unknown-elf-gcc --version
71+
72+
###########################################
73+
# libtock-c specific build steps begin here
74+
- uses: actions/checkout@v4
4175
with:
4276
submodules: recursive
43-
- uses: carlosperate/arm-none-eabi-gcc-action@v1
44-
- run: arm-none-eabi-gcc --version
45-
- name: setup-riscv-toolchain
46-
run: sudo apt-get install -y gcc-riscv64-unknown-elf
77+
show-progress: false
4778
- name: Disable wget progress output
4879
run: |
4980
echo "verbose = off" >> $HOME/.wgetrc
5081
- name: ci-build
5182
run: pushd examples; ./build_all.sh || exit; popd
5283
- name: ci-debug-build
5384
run: pushd examples/blink; make debug RAM_START=0x20004000 FLASH_INIT=0x30051 || exit; popd
85+

Configuration.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ override CPPFLAGS_PIC += \
222222
# which a compiler is found.
223223
ifneq (,$(shell which riscv64-none-elf-gcc 2>/dev/null))
224224
TOOLCHAIN_rv32 := riscv64-none-elf
225+
else ifneq (,$(shell which riscv-none-elf-gcc 2>/dev/null))
226+
TOOLCHAIN_rv32 := riscv-none-elf
225227
else ifneq (,$(shell which riscv32-none-elf-gcc 2>/dev/null))
226228
TOOLCHAIN_rv32 := riscv32-none-elf
227229
else ifneq (,$(shell which riscv64-elf-gcc 2>/dev/null))

examples/format_all.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ normal=$(tput sgr0)
99
$SCRIPT_DIR/../tools/check_unstaged.sh || exit
1010
export TOCK_NO_CHECK_UNSTAGED=1
1111

12+
# Explicitly build no targets if we're only formatting.
13+
#
14+
# This allows a system (i.e., a CI instance) with no cross-compilers to still
15+
# format without generating any warnings.
16+
export TOCK_TARGETS=
17+
1218
function opt_rebuild {
1319
if [ "$CI" == "true" ]; then
1420
echo "::group::Verbose Rebuild for $1"

0 commit comments

Comments
 (0)