Skip to content

shellcheck: add workflow, shellcheck fix the scripts #14905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Shellcheck

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
shellcheck:
name: Check shell scripts
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update && sudo apt install -y shellcheck
- name: shellcheck
run: |
git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck
14 changes: 7 additions & 7 deletions misc/build-debug-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ if [[ $(uname) == Darwin ]]; then
LDFLAGS="-L$(brew --prefix openssl)/lib"
fi

curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
tar zxf Python-$VERSION.tgz
cd Python-$VERSION
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix=$PREFIX
curl -O https://www.python.org/ftp/python/"$VERSION"/Python-"$VERSION".tgz
tar zxf Python-"$VERSION".tgz
cd Python-"$VERSION"
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug --prefix="$PREFIX"
make -j4
make install
$PREFIX/bin/python3 -m pip install virtualenv
$PREFIX/bin/python3 -m virtualenv $VENV
ln -s python3-config $PREFIX/bin/python-config
"$PREFIX"/bin/python3 -m pip install virtualenv
"$PREFIX"/bin/python3 -m virtualenv "$VENV"
ln -s python3-config "$PREFIX"/bin/python-config
4 changes: 2 additions & 2 deletions misc/clean-mypyc.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
echo "Cleaning C/C++ build artifacts..."
(cd mypyc/lib-rt; make clean)
(cd mypyc/external/googletest/make; make clean)
(cd mypyc/lib-rt || exit; make clean)
(cd mypyc/external/googletest/make || exit; make clean)
8 changes: 4 additions & 4 deletions misc/test-stubgenc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -x

cd "$(dirname $0)/.."
cd "$(dirname "$0")/.."

# Install dependencies, demo project and mypy
python -m pip install -r test-requirements.txt
Expand All @@ -12,8 +12,8 @@ python -m pip install .

# Remove expected stubs and generate new inplace
STUBGEN_OUTPUT_FOLDER=./test-data/pybind11_mypy_demo/stubgen
rm -rf $STUBGEN_OUTPUT_FOLDER/*
stubgen -p pybind11_mypy_demo -o $STUBGEN_OUTPUT_FOLDER
rm -rf "${STUBGEN_OUTPUT_FOLDER:?}/"*
stubgen -p pybind11_mypy_demo -o "$STUBGEN_OUTPUT_FOLDER"

# Compare generated stubs to expected ones
git diff --exit-code $STUBGEN_OUTPUT_FOLDER
git diff --exit-code "$STUBGEN_OUTPUT_FOLDER"
6 changes: 3 additions & 3 deletions misc/trigger_wheel_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pip install -r mypy-requirements.txt
V=$(python3 -m mypy --version)
V=$(echo "$V" | cut -d" " -f2)

git clone --depth 1 https://${WHEELS_PUSH_TOKEN}@github.com/mypyc/mypy_mypyc-wheels.git build
git clone --depth 1 https://"${WHEELS_PUSH_TOKEN}"@github.com/mypyc/mypy_mypyc-wheels.git build
cd build
echo $COMMIT > mypy_commit
echo "$COMMIT" > mypy_commit
git commit -am "Build wheels for mypy $V"
git tag v$V
git tag v"$V"
# Push a tag, but no need to push the change to master
git push --tags