feat: Test framework modernization BDD #1526
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and similar things for test | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- main | |
jobs: | |
scriptcheck: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: 🦪 ✔ 🧼🧼🧼 | |
run: >- | |
docker run --rm -v "$PWD:/mnt" --workdir "/mnt" "koalaman/shellcheck:v0.8.0" --color=always \ | |
$(find . -type f -exec grep -m1 -l -E '^#!.*sh.*' {} \; | grep -v '/.git/') | |
- uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: '3.13' | |
enable-cache: true | |
- name: 🧽 🐍 | |
run: |- | |
uv venv | |
uv pip sync requirements.txt | |
uv run ruff check --exit-zero . | |
if uv run black --check . ; then | |
echo "Black formatting check passed." | |
else | |
echo "Black formatting check failed. Please run 'uvx black .' to format your code." | |
fi | |
working-directory: . | |
- name: Run Pyright and summarize errors if any | |
run: | | |
set +e | |
OUTPUT=$(uv run pyright 2>&1) | |
STATUS=$? | |
if [ $STATUS -ne 0 ]; then | |
echo -e "## type check error\n\`\`\`\n$OUTPUT\n\`\`\`" >> $GITHUB_STEP_SUMMARY | |
elif [[ -z "$OUTPUT" || "$OUTPUT" == '0 errors, 0 warnings, 0 informations'* ]]; then | |
echo "No type errors found." | |
else | |
echo "Type check passed with warnings.\n\n$OUTPUT" | |
fi |