]> wimlib.net Git - wimlib/blobdiff - .github/workflows/ci.yml
ci.yml: add shellcheck job
[wimlib] / .github / workflows / ci.yml
index c4718b8feb97bfc2a5fb7cd9ff75241ddbeb157f..cd94dc4af214caa2a8e90b31af8e255e76eb86b2 100644 (file)
@@ -2,7 +2,7 @@ name: CI
 on: [pull_request, push]
 env:
   DEF_CFLAGS: -O2 -g -Wall -Werror
-  DEPENDENCIES: autoconf automake libtool pkg-config libfuse-dev ntfs-3g-dev
+  DEPENDENCIES: autoconf automake libtool pkgconf libfuse-dev ntfs-3g-dev ntfs-3g
 
 jobs:
   gcc-build-and-test:
@@ -76,7 +76,7 @@ jobs:
         sudo apt-get update
         sudo apt-get install -y clang $DEPENDENCIES
     - run: ./bootstrap
-    - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=address"
+    - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=address -fno-sanitize-recover=address"
     - run: make -j8 check V=1
     - uses: actions/upload-artifact@v3
       if: failure()
@@ -94,7 +94,7 @@ jobs:
         sudo apt-get update
         sudo apt-get install -y clang $DEPENDENCIES
     - run: ./bootstrap
-    - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=undefined"
+    - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
     - run: make -j8 check V=1
     - uses: actions/upload-artifact@v3
       if: failure()
@@ -102,6 +102,18 @@ jobs:
         name: ubsan-test-logs
         path: tests/*.log
 
+  run-shellcheck:
+    name: Run shellcheck
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    - name: Install dependencies
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y shellcheck
+    - name: Run shellcheck
+      run: shellcheck tools/*.sh tools/*/*.sh
+
   macos-build-and-test:
     name: Build and test on macOS
     runs-on: macos-latest
@@ -127,16 +139,21 @@ jobs:
     strategy:
       matrix:
         include:
-        - { sys: mingw32, env: i686 }
-        - { sys: mingw64, env: x86_64 }
+        - { msystem: MINGW32, cc_pkg: mingw-w64-i686-gcc }
+        - { msystem: MINGW64, cc_pkg: mingw-w64-x86_64-gcc }
+        - { msystem: CLANG32, cc_pkg: mingw-w64-clang-i686-clang }
+        - { msystem: CLANG64, cc_pkg: mingw-w64-clang-x86_64-clang }
+        - { msystem: CLANGARM64, options: --install-prerequisites }
     defaults:
       run:
         shell: msys2 {0}
     steps:
     - uses: actions/checkout@v3
+      with:
+        fetch-depth: 0  # Need tags for tools/get-version-number.sh
     - uses: msys2/setup-msys2@v2
       with:
-        msystem: ${{matrix.sys}}
+        msystem: ${{matrix.msystem}}
         update: true
         install: >
           autoconf
@@ -144,6 +161,44 @@ jobs:
           git
           libtool
           make
-          mingw-w64-${{matrix.env}}-gcc
+          ${{matrix.cc_pkg}}
           pkgconf
-    - run: CFLAGS="$DEF_CFLAGS" ./tools/make-windows-release --no-docs --no-zip
+    - run: CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh ${{matrix.options}}
+    - uses: actions/upload-artifact@v3
+      with:
+        name: windows-${{matrix.msystem}}-bin
+        path: wimlib-*-bin
+
+  fuzz-with-libFuzzer:
+    name: Fuzz with libFuzzer (${{matrix.target}} ${{matrix.sanitizer}})
+    strategy:
+      matrix:
+        include:
+        - target: wim
+          sanitizer:
+        - target: wim
+          sanitizer: --asan --ubsan
+        - target: xml
+          sanitizer:
+        - target: xml
+          sanitizer: --asan --ubsan
+        - target: compress
+          sanitizer:
+        - target: compress
+          sanitizer: --asan --ubsan
+        - target: decompress
+          sanitizer:
+        - target: decompress
+          sanitizer: --asan --ubsan
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    - name: Install dependencies
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y clang $DEPENDENCIES
+    - run: ./bootstrap
+    - name: Fuzz
+      run: |
+        tools/libFuzzer/fuzz.sh --time=120 ${{matrix.sanitizer}} \
+            ${{matrix.target}}