fix(ci): remove container field to run on host directly

This commit is contained in:
2026-06-26 18:40:04 +08:00
parent dea8f858ae
commit 47c8315e89
+3 -28
View File
@@ -18,35 +18,10 @@ jobs:
validate:
name: Validate Code Quality And Tests
runs-on: ubuntu-latest
container: xiaoxia-ci-python:3.12
steps:
- name: Checkout code
run: |
python - <<'PY'
import os
import tarfile
import urllib.request
api_url = os.environ['GITHUB_API_URL']
repository = os.environ['GITHUB_REPOSITORY']
sha = os.environ['GITHUB_SHA']
token = os.environ.get('GITHUB_TOKEN', '')
archive_url = f"{api_url}/repos/{repository}/archive/{sha}.tar.gz"
request = urllib.request.Request(archive_url)
if token:
request.add_header('Authorization', f'token {token}')
with urllib.request.urlopen(request, timeout=120) as response:
with open('/tmp/repo.tar.gz', 'wb') as archive:
archive.write(response.read())
with tarfile.open('/tmp/repo.tar.gz', 'r:gz') as archive:
members = archive.getmembers()
top_level = members[0].name.split('/')[0] + '/'
for member in members:
member.name = member.name.removeprefix(top_level)
if member.name:
archive.extract(member, '.')
PY
uses: actions/checkout@v4
- name: Verify CI environment
run: |
@@ -57,7 +32,7 @@ jobs:
python -m flake8 --version
bandit --version
pytest --version
echo "✅ Prebuilt CI environment is ready"
echo "CI environment is ready"
- name: Run code quality checks
run: |
@@ -91,6 +66,6 @@ jobs:
- name: Build summary
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
run: |
echo "Build completed successfully!"
echo "Build completed successfully!"
echo "Branch: ${GITHUB_REF_NAME}"
echo "Commit: ${GITHUB_SHA}"