fix: portable runtime layout #566
Workflow file for this run
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: Check Scripts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| scripts: | |
| name: node + python syntax checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| - name: Setup Toolchains | |
| uses: ./.github/actions/setup-toolchains | |
| with: | |
| node-version: '20' | |
| python-version: '3.12' | |
| - name: Check Node scripts syntax | |
| run: | | |
| set -euo pipefail | |
| if [ ! -d scripts ]; then | |
| echo "scripts directory does not exist, skip Node scripts check." | |
| exit 0 | |
| fi | |
| while IFS= read -r -d '' file; do | |
| echo "Checking ${file}" | |
| node --check "${file}" | |
| done < <(find scripts -type f \( -name '*.mjs' -o -name '*.cjs' -o -name '*.js' \) -print0 | sort -z) | |
| - name: Run Node script behavior tests | |
| run: | | |
| set -euo pipefail | |
| if [ ! -d scripts ]; then | |
| echo "scripts directory does not exist, skip Node script tests." | |
| exit 0 | |
| fi | |
| mapfile -d '' test_files < <(find scripts -type f -name '*.test.mjs' -print0 | sort -z) | |
| if [ "${#test_files[@]}" -eq 0 ]; then | |
| echo "No Node script test files found (*.test.mjs), skip." | |
| exit 0 | |
| fi | |
| echo "Running Node script tests:" | |
| for file in "${test_files[@]}"; do | |
| echo " - ${file}" | |
| done | |
| node --test "${test_files[@]}" | |
| - name: Check Python scripts syntax | |
| run: | | |
| set -euo pipefail | |
| if [ ! -d scripts ]; then | |
| echo "scripts directory does not exist, skip Python scripts check." | |
| exit 0 | |
| fi | |
| python3 -m compileall -q scripts | |
| - name: Run Python script behavior tests | |
| run: | | |
| set -euo pipefail | |
| if [ ! -d scripts/ci ]; then | |
| echo "scripts/ci directory does not exist, skip Python script tests." | |
| exit 0 | |
| fi | |
| mapfile -t test_files < <(find scripts/ci -type f -name 'test_*.py' | sort) | |
| if [ "${#test_files[@]}" -eq 0 ]; then | |
| echo "No Python script tests found (test_*.py), skip." | |
| exit 0 | |
| fi | |
| python3 -m unittest discover -s scripts/ci -p 'test_*.py' |