From 4b0b7ec216ec1a1f337a3a37b2c514bcd6842629 Mon Sep 17 00:00:00 2001 From: rusty-snake <41237666+rusty-snake@users.noreply.github.com> Date: Sun, 29 Nov 2020 14:04:22 +0000 Subject: Update build.yml (#3779) * Update build.yml Currently we run all actions for all commits. This is not resource friendly. Let's tweak this a bit. This commit adds support for "skip ci" tags (i.e. if the head commit contains [s k i p c i] (w/o the extra spaces used to escape here), no jobs are executed. In addition are all commits which modify non-code files (e.g. README) only excluded. Furthermore we should not run cppcheck and scan-build if only profiles are changed and sort.py need only to be execute if profiles are changed. * Create sort.yml * Update build.yml profile-sort is now in sort.yml * Update sort.yml fix syntax * Update codeql-analysis.yml paths-ignore: - CONTRIBUTING.md - README - README.md - RELNOTES - SECURITY.md - 'etc/**' * Create build-extra.yml * Update build.yml * Update build-extra.yml --- .github/workflows/build-extra.yml | 52 +++++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 45 +++++++++--------------------- .github/workflows/codeql-analysis.yml | 14 ++++++++++ .github/workflows/sort.yml | 21 ++++++++++++++ 4 files changed, 100 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/build-extra.yml create mode 100644 .github/workflows/sort.yml diff --git a/.github/workflows/build-extra.yml b/.github/workflows/build-extra.yml new file mode 100644 index 000000000..1468ef898 --- /dev/null +++ b/.github/workflows/build-extra.yml @@ -0,0 +1,52 @@ +name: Build-extra CI + +on: + push: + branches: [ master ] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md + - 'etc/**' + pull_request: + branches: [ master ] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md + - 'etc/**' + +jobs: + build-clang: + if: ${{ ! contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: configure + run: CC=clang-10 ./configure --enable-fatal-warnings + - name: make + run: make + scan-build: + if: ${{ ! contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: install clang-tools-10 + run: sudo apt-get install clang-tools-10 + - name: configure + run: CC=clang-10 ./configure --enable-fatal-warnings + - name: scan-build + run: NO_EXTRA_CFLAGS="yes" scan-build-10 --status-bugs make + cppcheck: + if: ${{ ! contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: install cppcheck + run: sudo apt-get install cppcheck + - name: cppcheck + run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71cb7f0b4..99b8a3be5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,11 +3,24 @@ name: Build CI on: push: branches: [ master ] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md pull_request: branches: [ master ] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md jobs: build_and_test: + if: ${{ ! contains(github.event.commits[0].message, '[skip ci]') }} runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -21,35 +34,3 @@ jobs: run: sudo make install - name: run tests run: SHELL=/bin/bash make test-github - build-clang: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: configure - run: CC=clang-10 ./configure --enable-fatal-warnings - - name: make - run: make - scan-build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: install clang-tools-10 - run: sudo apt-get install clang-tools-10 - - name: configure - run: CC=clang-10 ./configure --enable-fatal-warnings - - name: scan-build - run: NO_EXTRA_CFLAGS="yes" scan-build-10 --status-bugs make - cppcheck: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: install cppcheck - run: sudo apt-get install cppcheck - - name: cppcheck - run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . - profile-sort: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: check profiles - run: ./contrib/sort.py etc/*/{*.inc,*.net,*.profile} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a37bbb5c7..301c7fad2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,9 +8,23 @@ name: "CodeQL" on: push: branches: [master] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md + - 'etc/**' pull_request: # The branches below must be a subset of the branches above branches: [master] + paths-ignore: + - CONTRIBUTING.md + - README + - README.md + - RELNOTES + - SECURITY.md + - 'etc/**' schedule: - cron: '0 7 * * 2' diff --git a/.github/workflows/sort.yml b/.github/workflows/sort.yml new file mode 100644 index 000000000..55ac065b6 --- /dev/null +++ b/.github/workflows/sort.yml @@ -0,0 +1,21 @@ +name: sort.py + +on: + push: + branches: [ master ] + paths: + - 'etc/**' + pull_request: + branches: [ master ] + paths: + - 'etc/**' + +jobs: + profile-sort: + if: ${{ ! contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: check profiles + run: ./contrib/sort.py etc/*/{*.inc,*.profile} + -- cgit v1.2.3-54-g00ecf