ci: avoid installing node in deployment runner
Verify mini program and deploy preview / verify-deploy (push) Failing after 29s
Verify mini program and deploy preview / verify-deploy (push) Failing after 29s
This commit is contained in:
@@ -5,7 +5,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: rice-pk-xhs-production
|
group: rice-pk-xhs-production
|
||||||
cancel-in-progress: false
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
verify-deploy:
|
verify-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
env: { SOURCE_TOKEN: "${{ secrets.GITEA_TOKEN || gitea.token }}" }
|
env: { SOURCE_TOKEN: "${{ secrets.GITEA_TOKEN || gitea.token }}" }
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache python3 nodejs npm curl
|
apk add --no-cache python3 curl
|
||||||
python3 - <<'PY'
|
python3 - <<'PY'
|
||||||
import io,os,shutil,tarfile,tempfile,urllib.request
|
import io,os,shutil,tarfile,tempfile,urllib.request
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
roots=list(Path(d).iterdir());shutil.copytree(roots[0],Path.cwd(),dirs_exist_ok=True)
|
roots=list(Path(d).iterdir());shutil.copytree(roots[0],Path.cwd(),dirs_exist_ok=True)
|
||||||
PY
|
PY
|
||||||
- name: Check source and preview
|
- name: Check source and preview
|
||||||
run: npm run check
|
run: python3 scripts/check.py
|
||||||
- name: Build preview image
|
- name: Build preview image
|
||||||
run: docker build -t "rice-pk-xhs:$SOURCE_REVISION" .
|
run: docker build -t "rice-pk-xhs:$SOURCE_REVISION" .
|
||||||
- name: Update permanent preview container
|
- name: Update permanent preview container
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
required = [
|
||||||
|
"app.js",
|
||||||
|
"app.json",
|
||||||
|
"pages/index/index.xhsml",
|
||||||
|
"pages/test/test.js",
|
||||||
|
"pages/result/result.js",
|
||||||
|
"web/index.html",
|
||||||
|
"web/app.js",
|
||||||
|
]
|
||||||
|
missing = [name for name in required if not Path(name).is_file()]
|
||||||
|
if missing:
|
||||||
|
raise SystemExit("Missing required files: " + ", ".join(missing))
|
||||||
|
|
||||||
|
json.loads(Path("app.json").read_text())
|
||||||
|
print(f"Static checks passed ({len(required)} required files).")
|
||||||
Reference in New Issue
Block a user