Update meesho-scraper-api #2
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: checks | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| syntax: | |
| name: Example syntax | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Python | |
| run: | | |
| shopt -s nullglob | |
| files=(examples/*.py) | |
| if [ ${#files[@]} -eq 0 ]; then echo "no python examples"; exit 0; fi | |
| for f in "${files[@]}"; do echo "checking $f"; python -m py_compile "$f"; done | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Node | |
| run: | | |
| shopt -s nullglob | |
| files=(examples/*.js) | |
| if [ ${#files[@]} -eq 0 ]; then echo "no node examples"; exit 0; fi | |
| for f in "${files[@]}"; do echo "checking $f"; node --check "$f"; done | |
| - name: JSON | |
| run: | | |
| shopt -s nullglob | |
| files=(examples/*.json) | |
| if [ ${#files[@]} -eq 0 ]; then echo "no json examples"; exit 0; fi | |
| for f in "${files[@]}"; do echo "checking $f"; python -c "import json,sys;json.load(open(sys.argv[1]))" "$f"; done | |
| - name: Shell | |
| run: | | |
| shopt -s nullglob | |
| files=(examples/*.sh) | |
| if [ ${#files[@]} -eq 0 ]; then echo "no shell examples"; exit 0; fi | |
| for f in "${files[@]}"; do echo "checking $f"; bash -n "$f"; done | |
| links: | |
| name: Documentation links resolve | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check every scrapingbee.com and github.com URL | |
| run: | | |
| fail=0 | |
| urls=$(grep -ohE 'https://(www\.)?(scrapingbee|github)\.com[^)"< ]*' README.md examples/* 2>/dev/null \ | |
| | sed 's/[.,]$//' | sort -u) | |
| for u in $urls; do | |
| code=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 "$u" || echo 000) | |
| if [ "$code" != "200" ]; then | |
| echo "FAIL $code $u" | |
| fail=1 | |
| else | |
| echo "ok $u" | |
| fi | |
| done | |
| exit $fail |