build.yml: Sync with nuttx version

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-11 23:16:16 +08:00 committed by Petro Karashchenko
parent 80ed2b96d3
commit e07d8f546a

View File

@ -103,6 +103,7 @@ jobs:
- name: Tar sources - name: Tar sources
run: tar zcf sources.tar.gz sources run: tar zcf sources.tar.gz sources
- name: Archive Source Bundle - name: Archive Source Bundle
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -117,7 +118,7 @@ jobs:
strategy: strategy:
matrix: matrix:
boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa] boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa, codechecker]
steps: steps:
- name: Download Source Artifact - name: Download Source Artifact
@ -125,19 +126,23 @@ jobs:
with: with:
name: source-bundle name: source-bundle
path: . path: .
- name: Extract sources - name: Extract sources
run: tar zxf sources.tar.gz run: tar zxf sources.tar.gz
- name: Docker Login - name: Docker Login
uses: azure/docker-login@v1 uses: docker/login-action@v2
with: with:
login-server: ghcr.io registry: ghcr.io
username: ${GITHUB_ACTOR} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Pull - name: Docker Pull
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux
- name: Export NuttX Repo SHA - name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run builds - name: Run builds
uses: ./sources/nuttx/.github/actions/ci-container uses: ./sources/nuttx/.github/actions/ci-container
env: env:
@ -145,15 +150,18 @@ jobs:
with: with:
run: | run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json" echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci cd sources/nuttx/tools/ci
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
ccache -s ./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 - uses: actions/upload-artifact@v3
if: ${{ always() }}
with: with:
name: linux-builds name: linux-builds
path: buildartifacts/ path: buildartifacts/
@ -173,15 +181,17 @@ jobs:
with: with:
name: source-bundle name: source-bundle
path: . path: .
- name: Extract sources - name: Extract sources
run: tar zxf sources.tar.gz run: tar zxf sources.tar.gz
- name: Restore Tools Cache - name: Restore Tools Cache
id: cache-tools id: cache-tools
uses: actions/cache@v3 uses: actions/cache@v3
env: env:
cache-name: ${{ runner.os }}-cache-tools cache-name: ${{ runner.os }}-cache-tools
with: with:
path: prebuilt path: ./sources/tools
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }} key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }}
- name: Export NuttX Repo SHA - name: Export NuttX Repo SHA
@ -195,12 +205,10 @@ jobs:
- name: Run Builds - name: Run Builds
run: | run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json" echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci cd sources/nuttx/tools/ci
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat ./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: macos-builds name: macos-builds