Skip to content

Commit

Permalink
CI: create review.yml file
Browse files Browse the repository at this point in the history
Create review.yml used by GitHub actions. Add make
probe on every pull request.

Signed-off-by: Kinga Stefaniuk <[email protected]>
  • Loading branch information
ktanska committed Apr 11, 2024
1 parent 256edae commit 66f015d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .checkpatch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--exclude .github
--exclude clustermd_tests
--exclude documentation
--exclude misc
--exclude systemd
--exclude tests
--exclude *.md
--exclude *.4
--exclude *.in
--exclude *.8
--exclude test
--exclude udev-*
12 changes: 12 additions & 0 deletions .github/tools/install_ubuntu_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/bash

VERSION_CODENAME=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')
echo "Detected VERSION_CODENAME: $VERSION_CODENAME"

# Add ubuntu repository
sudo add-apt-repository -y "deb [arch=amd64] http://archive.ubuntu.com/ubuntu $VERSION_CODENAME \
main universe"
# Install gcc
sudo apt-get -y update && sudo apt-get -y install gcc-$1 g++-$1
# Install dependencies
sudo apt-get -y install make gcc libudev-dev devscripts
50 changes: 50 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: review
on: [pull_request]
env:
cflags: -Werror
jobs:
make:
runs-on: ubuntu-latest
name: Compilation test with gcc
strategy:
matrix:
gcc-version: [7, 8, 9, 10, 11, 12, 13]
steps:
- uses: actions/checkout@v3
- name: 'Add ubuntu repository and install dependencies'
run: .github/tools/install_ubuntu_packages.sh ${{ matrix.gcc-version }}
- name: 'Make with DEBUG flag'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-DEBUG && make clean
- name: 'Make with DEBIAN flag'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXGALGS=-DEBIAN && make clean
- name: 'Make with USE_PTHREADS flag'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-USE_PTHREADS && make clean
- name: 'Make with DNO_LIBUDEV flag'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) -B CXFLAGS=-DNO_LIBUDEV && make clean
- name: 'Make'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc)
checkpatch:
runs-on: ubuntu-latest
name: checkpatch review
steps:
- name: 'Calculate PR commits + 1'
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
- name: Run checkpatch review
uses: webispy/checkpatch-action@v9
hardening-check:
runs-on: ubuntu-latest
name: hardening check
steps:
- uses: actions/checkout@v3
- name: 'Add ubuntu repository and install dependencies'
run: .github/tools/install_ubuntu_packages.sh ${{ matrix.gcc-version }}
- name: 'Make'
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc)
- name: 'Hardening check: mdadm'
run: hardening-check mdadm
- name: 'Hardening check: mdmon'
run: hardening-check mdmon
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release [mdadm-4.3](https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/log/?h=mdadm-4.3)

Features:
Febbbbatures:
- **IMSM_NO_PLATFORM** boot parameter support from Neil Brown.
- **--write-zeros** option support by Logan Gunthorpe.
- **IMSM** monetization by VMD register from Mateusz Grzonka.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# define "CXFLAGS" to give extra flags to CC.
# e.g. make CXFLAGS=-O to optimise
CXFLAGS ?=-O2 -D_FORTIFY_SOURCE=2
CXFLAGS ?=-O2
TCC = tcc
UCLIBC_GCC = $(shell for nm in i386-uclibc-linux-gcc i386-uclibc-gcc; do which $$nm > /dev/null && { echo $$nm ; exit; } ; done; echo false No uclibc found )
#DIET_GCC = diet gcc
Expand Down

0 comments on commit 66f015d

Please sign in to comment.