Skip to content

Commit

Permalink
Update build.yml (#3779)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rusty-snake committed Nov 29, 2020
1 parent c7272ba commit 4b0b7ec
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 32 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build-extra.yml
Original file line number Diff line number Diff line change
@@ -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 .
45 changes: 13 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
14 changes: 14 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/sort.yml
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 4b0b7ec

Please sign in to comment.