summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build_release.yml51
-rw-r--r--.github/workflows/ci.yml169
-rw-r--r--.github/workflows/codeql-analysis.yml49
3 files changed, 269 insertions, 0 deletions
diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml
new file mode 100644
index 0000000..655853c
--- /dev/null
+++ b/.github/workflows/build_release.yml
@@ -0,0 +1,51 @@
+name: Build Source Release
+
+# Trigger whenever a release is created
+on:
+ release:
+ types:
+ - created
+
+jobs:
+ build:
+ name: build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: archive
+ id: archive
+ run: |
+ VERSION=${{ github.event.release.tag_name }}
+ PKGNAME="htop-$VERSION"
+ SHASUM=$PKGNAME.tar.xz.sha256
+ autoreconf -i
+ mkdir -p /tmp/$PKGNAME
+ mv * /tmp/$PKGNAME
+ mv /tmp/$PKGNAME .
+ TARBALL=$PKGNAME.tar.xz
+ tar cJf $TARBALL $PKGNAME
+ sha256sum $TARBALL > $SHASUM
+ echo "::set-output name=tarball::$TARBALL"
+ echo "::set-output name=shasum::$SHASUM"
+ - name: upload tarball
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./${{ steps.archive.outputs.tarball }}
+ asset_name: ${{ steps.archive.outputs.tarball }}
+ asset_content_type: application/gzip
+
+ - name: upload shasum
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./${{ steps.archive.outputs.shasum }}
+ asset_name: ${{ steps.archive.outputs.shasum }}
+ asset_content_type: text/plain
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..2e75ec0
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,169 @@
+name: CI
+
+on: [ push, pull_request ]
+
+env:
+ # Enable format attributes in ncurses headers
+ # Enable fortified memory/string handling
+ CPPFLAGS: -DGCC_PRINTF -DGCC_SCANF -D_FORTIFY_SOURCE=2
+
+jobs:
+ build-ubuntu-latest-minimal-gcc:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends libncursesw5-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors
+ - name: Enable compatibility modes
+ run: |
+ sed -i 's/#define HAVE_FSTATAT 1/#undef HAVE_FSTATAT/g' config.h
+ sed -i 's/#define HAVE_OPENAT 1/#undef HAVE_OPENAT/g' config.h
+ sed -i 's/#define HAVE_READLINKAT 1/#undef HAVE_READLINKAT/g' config.h
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
+
+ build-ubuntu-latest-minimal-clang:
+ runs-on: ubuntu-latest
+ env:
+ CC: clang-15
+ steps:
+ - uses: actions/checkout@v3
+ - name: install clang repo
+ run: |
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
+ sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main' -y
+ sudo apt-get update -q
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends clang-15 libncursesw5-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
+
+ build-ubuntu-latest-full-featured-gcc:
+ runs-on: ubuntu-latest
+ # Enable LTO, might trigger additional warnings on advanced inlining
+ env:
+ CFLAGS: -O3 -g -flto
+ LDFLAGS: -O3 -g -flto -Wl,--as-needed
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
+
+ build-ubuntu-latest-full-featured-clang:
+ runs-on: ubuntu-latest
+ env:
+ CC: clang-15
+ steps:
+ - uses: actions/checkout@v3
+ - name: install clang repo
+ run: |
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
+ sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main' -y
+ sudo apt-get update -q
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends clang-15 libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
+
+ build-ubuntu-latest-gcc-static:
+ runs-on: ubuntu-latest
+ # Enable LTO, might trigger additional warnings on advanced inlining
+ env:
+ CFLAGS: -O3 -g -flto
+ LDFLAGS: -O3 -g -flto
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends libncursesw5-dev libtinfo-dev libgpm-dev libsensors4-dev libcap-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities'
+
+ build-ubuntu-latest-pcp:
+ # we want PCP v5.2.3+
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends libpcp3-dev libncursesw5-dev libtinfo-dev libgpm-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror --enable-pcp --enable-unicode
+ - name: Build
+ run: make -k
+
+ build-ubuntu-latest-clang-analyzer:
+ runs-on: ubuntu-latest
+ env:
+ CC: clang-15
+ steps:
+ - uses: actions/checkout@v3
+ - name: install clang repo
+ run: |
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
+ sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main' -y
+ sudo apt-get update -q
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends clang-15 clang-tools-15 libncursesw5-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: scan-build-15 -analyze-headers --status-bugs ./configure --enable-debug --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-delayacct --enable-sensors --enable-capabilities
+ - name: Build
+ run: scan-build-15 -analyze-headers --status-bugs make -j"$(nproc)"
+
+ build-macos-latest-clang:
+ runs-on: macOS-latest
+ env:
+ CC: clang
+ steps:
+ - uses: actions/checkout@v3
+ - name: Install Dependencies
+ run: brew install automake
+ - name: Bootstrap
+ run: ./autogen.sh
+ - name: Configure
+ run: ./configure --enable-werror
+ - name: Build
+ run: make -k
+ - name: Distcheck
+ run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror"
+
+ whitespace_check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: check-whitespaces
+ run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000..17356b6
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,49 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+ schedule:
+ - cron: '0 1 * * 0'
+
+permissions:
+ contents: read
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ security-events: write
+
+ env:
+ # Enable format attributes in ncurses headers
+ # Enable fortified memory/string handling
+ CPPFLAGS: -DGCC_PRINTF -DGCC_SCANF -D_FORTIFY_SOURCE=2
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v3
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: cpp
+
+ - name: Install Dependencies
+ run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors4-dev libcap-dev
+
+ - name: Bootstrap
+ run: ./autogen.sh
+
+ - name: Configure
+ run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities
+
+ - name: Build
+ run: make
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2