mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
CI: Migrate ci tooling from testing repository to main os repo
This commit is contained in:
committed by
Xiang Xiao
parent
9097244cb8
commit
15b99d1f4b
@@ -0,0 +1,25 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
name: ci-container
|
||||
inputs:
|
||||
run: # id of input
|
||||
description: 'Commands to run'
|
||||
required: true
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'docker.pkg.github.com/apache/incubator-nuttx/apache-nuttx-ci-linux'
|
||||
args:
|
||||
- "/bin/bash"
|
||||
- "-ce"
|
||||
- ${{ inputs.run }}
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
id: gittargets
|
||||
shell: bash
|
||||
run: |
|
||||
TESTING_REF="master" # Always use master for testing
|
||||
OS_REF=""
|
||||
APPS_REF=""
|
||||
|
||||
@@ -80,7 +79,6 @@ jobs:
|
||||
|
||||
echo ::set-output name=os_ref::$OS_REF
|
||||
echo ::set-output name=apps_ref::$APPS_REF
|
||||
echo ::set-output name=testing_ref::$TESTING_REF
|
||||
|
||||
- name: Checkout nuttx repo
|
||||
uses: actions/checkout@v2
|
||||
@@ -100,14 +98,6 @@ jobs:
|
||||
path: sources/apps
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: apache/incubator-nuttx-testing
|
||||
ref: ${{ steps.gittargets.outputs.testing_ref }}
|
||||
path: sources/testing
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Tar sources
|
||||
run: tar zcf sources.tar.gz sources
|
||||
- name: Archive Source Bundle
|
||||
@@ -142,11 +132,11 @@ jobs:
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Docker Pull
|
||||
run: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux
|
||||
run: docker pull docker.pkg.github.com/apache/incubator-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/testing/.github/actions/ci-container
|
||||
uses: ./sources/nuttx/.github/actions/ci-container
|
||||
env:
|
||||
BLOBDIR: /tools/blobs
|
||||
with:
|
||||
@@ -154,8 +144,8 @@ jobs:
|
||||
echo "::add-matcher::sources/nuttx/.github/gcc.json"
|
||||
export CCACHE_DIR=`pwd`/ccache
|
||||
mkdir $CCACHE_DIR
|
||||
cd sources/testing
|
||||
export ARTIFACTDIR=`pwd`/../../buildartifacts
|
||||
export ARTIFACTDIR=`pwd`/buildartifacts
|
||||
cd sources/nuttx/tools/ci
|
||||
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat
|
||||
ccache -s
|
||||
- uses: actions/upload-artifact@v2
|
||||
@@ -185,7 +175,7 @@ jobs:
|
||||
cache-name: ${{ runner.os }}-cache-tools
|
||||
with:
|
||||
path: prebuilt
|
||||
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/testing/cibuild.sh') }}
|
||||
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
|
||||
@@ -194,8 +184,8 @@ jobs:
|
||||
echo "::add-matcher::sources/nuttx/.github/gcc.json"
|
||||
export CCACHE_DIR=`pwd`/ccache
|
||||
mkdir $CCACHE_DIR
|
||||
cd sources/testing
|
||||
export ARTIFACTDIR=`pwd`/../../buildartifacts
|
||||
export ARTIFACTDIR=`pwd`/buildartifacts
|
||||
cd sources/nuttx/tools/ci
|
||||
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat
|
||||
ccache -s
|
||||
- uses: actions/upload-artifact@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Cancelling Duplicates
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build", "Check", "Build Documentation", "Lint"]
|
||||
workflows: ["Build", "Check", "Build Documentation", " Lint", "Docker-Linux"]
|
||||
types: ['requested']
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
name: Docker-Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
# Publish `master` as Docker `latest` image.
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'tools/ci/docker/linux/**'
|
||||
|
||||
# Run builds for any PRs.
|
||||
pull_request:
|
||||
paths:
|
||||
- 'tools/ci/docker/linux/**'
|
||||
|
||||
env:
|
||||
IMAGE_NAME: nuttx-ci-linux
|
||||
|
||||
jobs:
|
||||
# Push image to GitHub Packages.
|
||||
push:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
IMAGE_TAG: docker.pkg.github.com/${{ github.repository }}/nuttx-ci-linux
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Log into registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build Linux image
|
||||
run: |
|
||||
echo "Building Linux Image using cache from $IMAGE_TAG"
|
||||
|
||||
docker build \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--cache-from $IMAGE_TAG \
|
||||
--tag $IMAGE_TAG \
|
||||
-f ./tools/ci/docker/linux/Dockerfile ./tools/ci/docker/
|
||||
|
||||
- name: Push Linux image
|
||||
if: (github.event_name == 'push') && (github.ref == 'refs/heads/master')
|
||||
run: |
|
||||
docker push $IMAGE_TAG
|
||||
Reference in New Issue
Block a user