From 42ddd632d05bf302b2c1627ce57f964afa4524d2 Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:32:27 +0200 Subject: [PATCH] Run check_version directly in GH workflow removed bash scripts --- .github/workflows/check_version.yaml | 2 +- .github/workflows/shellcheck.yaml | 15 --------------- scripts/build/check_git_status.sh | 8 -------- scripts/build/check_release.sh | 11 ----------- scripts/build/setup_poetry_env.sh | 10 ---------- scripts/build/shellcheck.sh | 15 --------------- 6 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 .github/workflows/shellcheck.yaml delete mode 100755 scripts/build/check_git_status.sh delete mode 100755 scripts/build/check_release.sh delete mode 100644 scripts/build/setup_poetry_env.sh delete mode 100755 scripts/build/shellcheck.sh diff --git a/.github/workflows/check_version.yaml b/.github/workflows/check_version.yaml index cc43839..b5b709c 100644 --- a/.github/workflows/check_version.yaml +++ b/.github/workflows/check_version.yaml @@ -17,4 +17,4 @@ jobs: python-version: "3.10" poetry-version: '1.8.2' - name: Check Release - run: ./scripts/build/check_release.sh "python3.10" + run: poetry run python3 scripts/build/check_release.py diff --git a/.github/workflows/shellcheck.yaml b/.github/workflows/shellcheck.yaml deleted file mode 100644 index a29939e..0000000 --- a/.github/workflows/shellcheck.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Check bash scripts - -on: - push: - branches: - - main - pull_request: - -jobs: - shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run shellcheck - run: ./scripts/build/shellcheck.sh diff --git a/scripts/build/check_git_status.sh b/scripts/build/check_git_status.sh deleted file mode 100755 index 35e4d65..0000000 --- a/scripts/build/check_git_status.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -#Prints git status and returns > 0 if working tree is dirty! If working tree is clean, it returns 0. - -git status --porcelain=v1 -uno -git diff --cached; git diff --cached --summary; -[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ] - diff --git a/scripts/build/check_release.sh b/scripts/build/check_release.sh deleted file mode 100755 index 350c721..0000000 --- a/scripts/build/check_release.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" - -#shellcheck source=./scripts/build/setup_poetry_env.sh -source "$SCRIPT_DIR/setup_poetry_env.sh" "$@" - -poetry run python3 -u "$SCRIPT_DIR/check_release.py" diff --git a/scripts/build/setup_poetry_env.sh b/scripts/build/setup_poetry_env.sh deleted file mode 100644 index 2bc4478..0000000 --- a/scripts/build/setup_poetry_env.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -o errexit -set -o nounset -set -o pipefail - -PYTHON_VERSION=$1 - -PYTHON_BIN=$(command -v "$PYTHON_VERSION") -poetry env use "$PYTHON_BIN" -poetry install diff --git a/scripts/build/shellcheck.sh b/scripts/build/shellcheck.sh deleted file mode 100755 index d27b500..0000000 --- a/scripts/build/shellcheck.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -u - -interesting_paths=("scripts") - -SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -status=0 - -for path in "${interesting_paths[@]}"; do - find "$SCRIPT_DIR/../../$path" -name '*.sh' -type f -print0 | xargs -0 -n1 shellcheck -x - test $? -ne 0 && status=1 -done - -exit "$status" \ No newline at end of file