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

ci: Fix local CI #200

Merged
merged 3 commits into from
Jan 8, 2024
Merged
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
106 changes: 7 additions & 99 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,13 @@
name: Build

on:
pull_request:
paths-ignore:
- 'Documentation/**'
- 'tools/ci/docker/linux/**'
push:
paths-ignore:
- 'Documentation/**'
branches:
- master
- 'releases/*'
tags:
branches: [master]
pull_request:

permissions:
contents: read

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Fetch-Source:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -115,72 +103,13 @@ jobs:
name: source-bundle
path: sources.tar.gz

Linux:
needs: Fetch-Source
Build:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1

strategy:
matrix:
boards: [arm-12, risc-v]

steps:
- name: Download Source Artifact
uses: actions/download-artifact@v3
with:
name: source-bundle
path: .

- name: Extract sources
run: tar zxf sources.tar.gz

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Pull
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux

- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV

- name: Run builds
uses: ./sources/nuttx/.github/actions/ci-container
env:
BLOBDIR: /tools/blobs
with:
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
./cibuild.sh -c -A -R --codechecker testlist/${{matrix.boards}}.dat
else
./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat
fi

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: linux-builds
path: buildartifacts/
continue-on-error: true

macOS:
if: ${{ false }} # disable for now
permissions:
contents: none
runs-on: macos-13
needs: Fetch-Source
strategy:
fail-fast: false
matrix:
boards: [macos, sim-01, sim-02]
boards: [ssrc-arm, ssrc-riscv]
steps:
- name: Download Source Artifact
uses: actions/download-artifact@v3
Expand All @@ -191,32 +120,11 @@ jobs:
- name: Extract sources
run: tar zxf sources.tar.gz

- name: Restore Tools Cache
id: cache-tools
uses: actions/cache@v3
env:
cache-name: ${{ runner.os }}-cache-tools
with:
path: ./sources/tools
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }}

- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV

# Released version of Cython has issues with Python 11. Set runner to use Python 3.10
# https://github.com/cython/cython/issues/4500
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Builds
# cibuild.sh -i installs the tools for us
- name: Run builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci
./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat

- uses: actions/upload-artifact@v3
with:
name: macos-builds
path: buildartifacts/
continue-on-error: true
5 changes: 3 additions & 2 deletions libs/libc/machine/arm/armv7-m/arch_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ bool up_checkarch(const Elf32_Ehdr *ehdr)
*
****************************************************************************/

int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr,
void *arch_data)
{
int32_t offset;
uint32_t upper_insn;
Expand Down Expand Up @@ -510,7 +511,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
}

int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr)
uintptr_t addr, void *arch_data)
{
berr("ERROR: RELA relocation not supported\n");
return -ENOSYS;
Expand Down
6 changes: 3 additions & 3 deletions libs/libc/modlib/modlib_bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static int modlib_relocate(FAR struct module_s *modp,

/* Now perform the architecture-specific relocation */

ret = up_relocate(rel, sym, addr);
ret = up_relocate(rel, sym, addr, NULL);
if (ret < 0)
{
berr("ERROR: Section %d reloc %d: Relocation failed: %d\n",
Expand Down Expand Up @@ -522,7 +522,7 @@ static int modlib_relocateadd(FAR struct module_s *modp,

/* Now perform the architecture-specific relocation */

ret = up_relocateadd(rela, sym, addr);
ret = up_relocateadd(rela, sym, addr, NULL);
if (ret < 0)
{
berr("ERROR: Section %d reloc %d: Relocation failed: %d\n",
Expand Down Expand Up @@ -731,7 +731,7 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
else
dynsym.st_value = *(uint32_t *) addr -
loadinfo->datasec + loadinfo->datastart;
ret = up_relocate(rel, &dynsym, addr);
ret = up_relocate(rel, &dynsym, addr, NULL);
}

if (ret < 0)
Expand Down
12 changes: 6 additions & 6 deletions tools/ci/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function avr-gcc-toolchain {
brew install avr-gcc
;;
Linux)
apt-get install -y avr-libc gcc-avr
sudo apt-get install -y avr-libc gcc-avr
;;
esac
fi
Expand Down Expand Up @@ -187,7 +187,7 @@ function clang-tidy {
if ! type clang-tidy &> /dev/null; then
case ${os} in
Linux)
apt-get install -y clang clang-tidy
sudo apt-get install -y clang clang-tidy
;;
esac
fi
Expand Down Expand Up @@ -215,7 +215,7 @@ function util-linux {
brew install flock
;;
Linux)
apt-get install -y util-linux
sudo apt-get install -y util-linux
;;
esac
fi
Expand All @@ -231,7 +231,7 @@ function gen-romfs {
brew install genromfs
;;
Linux)
apt-get install -y genromfs
sudo apt-get install -y genromfs
;;
esac
fi
Expand Down Expand Up @@ -467,7 +467,7 @@ function u-boot-tools {
brew install u-boot-tools
;;
Linux)
apt-get install -y u-boot-tools
sudo apt-get install -y u-boot-tools
;;
esac
fi
Expand Down Expand Up @@ -588,7 +588,7 @@ case ${os} in
rm -f /usr/local/bin/openssl || :
;;
Linux)
install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain u-boot-tools util-linux wasi-sdk c-cache"
install="arm-gcc-toolchain binutils gen-romfs gperf kconfig-frontends python-tools riscv-gcc-toolchain c-cache"
;;
esac

Expand Down
2 changes: 2 additions & 0 deletions tools/ci/testlist/ssrc-arm.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/arm/stm32f7,CONFIG_ARM_TOOLCHAIN_GNU_EABI

2 changes: 2 additions & 0 deletions tools/ci/testlist/ssrc-riscv.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/risc-v/mpfs

Loading