Skip to content

Disable subprocess filtering / netpbm on Windows #282

Disable subprocess filtering / netpbm on Windows

Disable subprocess filtering / netpbm on Windows #282

Workflow file for this run

name: Continuous Integration
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux (libsixel)
os: ubuntu-latest
shell: bash
suffix: ""
sixel: true
- name: Linux (no libsixel)
os: ubuntu-latest
shell: bash
suffix: ""
sixel: false
- name: Linux (pdcurses)
os: ubuntu-latest
shell: bash
make_opts: "USE_PDCURSES=1"
suffix: ""
sixel: false
build_pdcurses: true
- name: macOS arm64
os: macos-13
shell: bash
suffix: "-macos-x86_64"
sixel: true
- name: macOS x86-64
os: macos-latest
shell: bash
suffix: "-macos-arm64"
sixel: true
steps:
- name: Install build dependencies (Homebrew, macOS)
if: runner.os == 'macOS'
run: brew install -q libsndfile ncurses libpng pandoc
- name: Install build dependencies (apt, Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt -q install libsndfile1-dev libncurses-dev libpng-dev \
gcc pkg-config
- name: Install libsixel (Homebrew, macOS)
if: runner.os == 'macOS' && matrix.config.sixel
run: brew install -q libsixel
- name: Install libsixel (apt, Linux)
if: runner.os == 'Linux' && matrix.config.sixel
run: sudo apt -q install libsixel-dev
- name: Check out code
uses: actions/checkout@v4
- name: Build pdcurses
if: matrix.config.build_pdcurses
run: |
sudo apt -q install libxt-dev libxaw7-dev
git submodule update --init deps/pdcurses
cd deps/pdcurses/x11
sed -i.bak "s/-lc//" Makefile.in
./configure --prefix=/tmp/pdcinst
make
make install
- name: Find Git version
id: version
run: |
if git describe --exact-match --tags >/dev/null; then
VERSION=$(git describe --exact-match --tags)
VERSION=${VERSION/#wadgadget-/}
else
VERSION=$(git rev-parse --short HEAD)
fi
VERSION=$VERSION${{ matrix.config.suffix }}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: make
run: |
PATH="/tmp/pdcinst/bin:$PATH" \
make -C src -j8 ${{matrix.config.make_opts}}
- name: Build package (macOS)
if: runner.os == 'macOS'
run: make -C pkg/macos
- name: Upload build (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
path: "pkg/macos/wadgadget.dmg"
name: wadgadget-${{steps.version.outputs.VERSION}}
style_checks:
name: Style checks
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt -q install clang-format
- name: Check out code
uses: actions/checkout@v4
- name: Check formatting
if: '!cancelled()'
run: |
make -C src format
git diff > formatting-fixes.diff
if ! grep "" formatting-fixes.diff; then
rm -f formatting-fixes.diff
else
(echo "Formatting errors detected by clang-format. Please run" \
"\`make format\` or apply formatting-fixes.diff below.";
echo) >> $GITHUB_STEP_SUMMARY
false
fi
- uses: actions/upload-artifact@v4
if: '!cancelled()'
with:
if-no-files-found: ignore
name: formatting-fixes.diff
path: formatting-fixes.diff
- name: Check for banned functions (should use checked_*)
if: '!cancelled()'
run: |
success=true
for func in malloc realloc calloc strdup \
sprintf vsprintf strcat strcpy; do
if grep -w $func src/*.c src/*/*.[ch]; then
success=false
fi
done
if ! $success; then
(echo "Use of banned functions detected. Please replace with the" \
"checked_* versions of these functions.";
echo) >> $GITHUB_STEP_SUMMARY
false
fi