mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
move clang-tidy from Jenkins to Github Actions
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
name: Clang Tidy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: px4io/px4-dev-clang:2020-04-01
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
token: ${{secrets.ACCESS_TOKEN}}
|
||||||
|
|
||||||
|
- name: Prepare ccache timestamp
|
||||||
|
id: ccache_cache_timestamp
|
||||||
|
shell: cmake -P {0}
|
||||||
|
run: |
|
||||||
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||||
|
message("::set-output name=timestamp::${current_date}")
|
||||||
|
- name: ccache cache files
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.ccache
|
||||||
|
key: clang-tidy-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
||||||
|
restore-keys: clang-tidy-ccache-
|
||||||
|
- name: setup ccache
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ccache
|
||||||
|
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
|
||||||
|
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||||
|
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
||||||
|
echo "max_size = 400M" >> ~/.ccache/ccache.conf
|
||||||
|
ccache -s
|
||||||
|
ccache -z
|
||||||
|
|
||||||
|
- name: make clang-tidy-quiet
|
||||||
|
run: |
|
||||||
|
ccache -z
|
||||||
|
make clang-tidy-quiet
|
||||||
|
ccache -s
|
||||||
Vendored
-22
@@ -120,28 +120,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Clang tidy') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'px4io/px4-dev-clang:2020-04-01'
|
|
||||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'export'
|
|
||||||
sh 'make distclean'
|
|
||||||
sh 'git fetch --tags'
|
|
||||||
retry (3) {
|
|
||||||
sh 'make clang-tidy-quiet'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
sh 'make distclean'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Cppcheck') {
|
stage('Cppcheck') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
|
|||||||
Reference in New Issue
Block a user