fix(ci): stabilize validation workflow
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1m17s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 1m17s
This commit is contained in:
@@ -15,8 +15,8 @@ on:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
code-quality:
|
||||
name: Code Quality Check
|
||||
validate:
|
||||
name: Validate Code Quality And Tests
|
||||
runs-on: ubuntu-latest
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
|
||||
@@ -26,57 +26,33 @@ jobs:
|
||||
git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git .
|
||||
git checkout ${GITHUB_SHA}
|
||||
|
||||
- name: Prepare quality environment
|
||||
- name: Prepare environment
|
||||
run: |
|
||||
python3 --version
|
||||
python3 -m venv .venv
|
||||
. .venv/bin/activate
|
||||
python -m pip install --index-url https://pypi.org/simple --upgrade pip
|
||||
python -m pip install --index-url https://pypi.org/simple -r requirements-quality.txt
|
||||
python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt
|
||||
|
||||
- name: Run checks
|
||||
- name: Run code quality checks
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
python -m black --version
|
||||
python -m isort --version-number
|
||||
python -m flake8 --version
|
||||
python -m mypy --version
|
||||
python -m bandit --version
|
||||
bandit --version
|
||||
echo "✅ Code quality environment is ready"
|
||||
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
if: ${{ success() }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth=1 --branch=${GITHUB_REF_NAME} https://api.xiaoxiajianji.com/git/${GITHUB_REPOSITORY}.git .
|
||||
git checkout ${GITHUB_SHA}
|
||||
|
||||
- name: Prepare test environment
|
||||
run: |
|
||||
python3 --version
|
||||
python3 -m venv .venv
|
||||
. .venv/bin/activate
|
||||
python -m pip install --index-url https://pypi.org/simple --upgrade pip
|
||||
python -m pip install --index-url https://pypi.org/simple -r requirements-dev.txt
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
pytest --version
|
||||
echo "✅ Test environment is ready"
|
||||
|
||||
build-summary:
|
||||
name: Build Summary
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') }}
|
||||
|
||||
steps:
|
||||
- name: Summary
|
||||
- name: Build summary
|
||||
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
echo "✅ Build completed successfully!"
|
||||
echo "Branch: ${GITHUB_REF_NAME}"
|
||||
|
||||
Reference in New Issue
Block a user