Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Robin Jarry

set -eu

echo ===========================================================================
git --no-pager log --oneline -1
echo ===========================================================================

# If there was any modification on .wrap files, delete the whole subproject
# folder to ensure it is prepared again by meson.
for wrap in subprojects/*.wrap; do
if ! git diff --quiet HEAD^ $wrap; then
rm -rf "${wrap%.wrap}"
fi
done

# Always check compilation.
make "$@"

if [ "$#" -eq 0 ] && ! echo "$MESON_EXTRA_OPTS" | grep -q -- --cross-file; then
# If the script was invoked without any argument (e.g. not with "lint")
# and if we are not cross compiling, run unit and smoke tests.
echo -------------------------------------------------------------------
echo unit-tests
echo -------------------------------------------------------------------
make unit-tests
echo -------------------------------------------------------------------
echo smoke-tests
echo -------------------------------------------------------------------
sudo make smoke-tests
fi
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ jobs:
path: ${{ env.CCACHE_DIR }}
key: ccache-x86_64-${{ matrix.conf.compiler }}
- run: ccache -z
- run: git rebase -x "git --no-pager log --oneline -1 && make all unit-tests && sudo smoke/run.sh build" "HEAD~${{ github.event.pull_request.commits }}"
- run: git rebase -x .github/workflows/check.sh "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ matrix.conf.rebase && github.event.pull_request.commits }}
- run: make all unit-tests && sudo smoke/run.sh build
- run: .github/workflows/check.sh
if: ${{ ! matrix.conf.rebase || ! github.event.pull_request.commits }}
- run: ccache -sv
- uses: actions/cache/save@v4
Expand Down Expand Up @@ -145,9 +145,9 @@ jobs:
path: ${{ env.CCACHE_DIR }}
key: ccache-aarch64
- run: ccache -z
- run: git rebase -x "git --no-pager log --oneline -1 && make" "HEAD~${{ github.event.pull_request.commits }}"
- run: git rebase -x .github/workflows/check.sh "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ github.event.pull_request.commits }}
- run: make
- run: .github/workflows/check.sh
if: ${{ ! github.event.pull_request.commits }}
- run: ccache -sv
- uses: actions/cache/save@v4
Expand All @@ -169,9 +169,9 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: git rebase -x "git --no-pager log --oneline -1 && make lint" "HEAD~${{ github.event.pull_request.commits }}"
- run: git rebase -x ".github/workflows/check.sh lint" "HEAD~${{ github.event.pull_request.commits }}"
if: ${{ github.event.pull_request.commits }}
- run: make lint
- run: .github/workflows/check.sh lint
if: ${{ ! github.event.pull_request.commits }}

commits:
Expand Down