Skip to content

README.asciidoc: update link to latest release #80

README.asciidoc: update link to latest release

README.asciidoc: update link to latest release #80

Workflow file for this run

# The contents below are based on sample configuration from CodeQL
# and on the variant of that file used in the main NUT repository.
#
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: "18 2 * * 0"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ cpp ]
nutsrc: [pkg280, trunk]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize dependencies (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install libxpm-dev libxext-dev libupsclient-dev libc6-dev-amd64-cross libgcc-s1-amd64-cross
- name: Initialize dependencies (ensure NUT 2.8.0+)
run: |
GITVER=''
case "${{matrix.nutsrc}}" in
"pkg280")
case "`pkg-config --modversion libupsclient | tee -a /dev/stderr`" in
[01].*|2.[01234567].*)
echo "WARNING: System-packaged NUT seems too old, will build dev profile from scratch" >&2
GITVER='v2.8.0'
;;
esac ;;
"trunk") GITVER="master" ;;
esac
if [ x"$GITVER" != x ] ; then
set -e ### abort on any non-zero exit code below
### Follow nut::docs/config-prereqs.txt chapter for Debian/Ubuntu
### to be sure, with a minimal set of third-party dependencies for
### a faster and practically useless build. Most or all of these
### are pre-installed in the image or by the above init, so there
### is little run-time impact of the APT operation here normally;
### these explicit installations help bolt down some auto-deps so
### they are surely not "apt-get remove"'d with the operation below:
sudo apt-get install build-essential git python3 perl curl make autoconf automake libtool pkg-config gcc ### g++ libltdl-dev python-is-python3 ### TODO: ccache + persistent build area?
git clone -b "$GITVER" -o upstream https://github.com/networkupstools/nut
cd nut
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --with-user=nut --with-group=nut --with-dev --without-all --without-docs --without-nut-scanner --enable-silent-rules
make -j 8 -s
sudo apt-get remove libupsclient-dev ### avoid conflicts/confusion just in case
sudo apt-get remove libupsclient4 || true
sudo make -s install ### overwrite system packaged files as too old
echo "=== Checking NUT libupsclient version seen by pkg-config:"
pkg-config --modversion libupsclient
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
env:
### Avoid installing obsolete libupsclient-dev
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"