diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59746e595..5ccd4aec0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,20 @@ on: branches: [ master ] jobs: + pre-commit: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Refresh dependencies + run: sudo apt update + - name: Install dependencies + run: sudo apt install shellcheck -y + - name: Run pre-commit hooks + run: | + ./contrib/setup + source venv/bin/activate + pre-commit run --all-files + abi: runs-on: ubuntu-20.04 steps: diff --git a/contrib/ci/fedora.sh b/contrib/ci/fedora.sh index 40e5dc6b0..98ec988e4 100755 --- a/contrib/ci/fedora.sh +++ b/contrib/ci/fedora.sh @@ -2,45 +2,6 @@ set -e set -x -# check for g_return_val_if_fail sanity -if ! ./contrib/ci/check-null-false-returns.py; then - exit 1 -fi - -# check for CRLF DOS-style line endings -all=`find . -type f -not -path "./.git/*"` -for fn in $all; do - if grep -IU $'\x0D' $fn; then - echo "DOS line endings detected" - exit 1 - fi -done - -# these are deprecated in favor of INTERNAL flags -deprecated="FWUPD_DEVICE_FLAG_NO_AUTO_INSTANCE_IDS - FWUPD_DEVICE_FLAG_ONLY_SUPPORTED - FWUPD_DEVICE_FLAG_MD_SET_NAME - FWUPD_DEVICE_FLAG_MD_SET_VERFMT - FWUPD_DEVICE_FLAG_NO_GUID_MATCHING - FWUPD_DEVICE_FLAG_MD_SET_ICON" -for val in $deprecated; do - if grep -- $val plugins/*/*.c ; then - exit 1 - fi -done - -# check shell scripts -dnf install -y ShellCheck -if ! find . -name '*.sh' | xargs shellcheck --severity=error -e SC2068; then - exit 1 -fi - -# check python code -dnf install -y black -if ! black --check --fast .; then - exit 1 -fi - #get any missing deps from the container ./contrib/ci/generate_dependencies.py | xargs dnf install -y