ci(deps): bump actions/upload-artifact from 4 to 6 (#48) #64
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: | |
| env: | |
| PYTHON_DEFAULT_VERSION: "3.12" | |
| jobs: | |
| lint: | |
| name: Code Quality & Linting | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Run black formatting check | |
| run: uv run black --check --diff . | |
| continue-on-error: true | |
| - name: Run isort import sorting check | |
| run: uv run isort --check-only --diff . | |
| continue-on-error: true | |
| - name: Run flake8 linting | |
| run: uv run flake8 . || true | |
| continue-on-error: true | |
| - name: Run bandit security linting | |
| run: uv run bandit -r iris_vector_rag/ -x tests/ || true | |
| continue-on-error: true | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras | |
| - name: Run unit tests | |
| run: | | |
| uv run pytest tests/unit/ \ | |
| --cov=iris_vector_rag \ | |
| --cov-report=xml \ | |
| --cov-report=term-missing \ | |
| --junit-xml=test-results-unit.xml \ | |
| -v || true | |
| continue-on-error: true | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.python-version == env.PYTHON_DEFAULT_VERSION | |
| with: | |
| file: ./coverage.xml | |
| flags: unit-tests | |
| name: codecov-umbrella | |
| continue-on-error: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v6 | |
| if: always() | |
| with: | |
| name: test-results-unit-${{ matrix.python-version }} | |
| path: test-results-unit.xml | |
| if-no-files-found: ignore | |
| build-and-test-docker: | |
| name: Build and Test Docker Images | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: lint | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t iris-vector-rag:test . || true | |
| continue-on-error: true | |
| - name: Test Docker image | |
| if: success() | |
| run: | | |
| docker run --rm iris-vector-rag:test python -c "import iris_vector_rag; print('Import successful')" || true | |
| continue-on-error: true | |
| coverage-report: | |
| name: Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests] | |
| if: always() | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@v7 | |
| continue-on-error: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
| - name: Install coverage tools | |
| run: | | |
| pip install coverage | |
| - name: Combine coverage reports | |
| run: | | |
| coverage combine || true | |
| coverage report || true | |
| coverage html || true | |
| continue-on-error: true | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v6 | |
| if: always() | |
| with: | |
| name: coverage-report | |
| path: htmlcov/ | |
| if-no-files-found: ignore | |
| security-scan: | |
| name: Security Scanning | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: lint | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| scan-type: 'fs' | |
| scan-ref: '.' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| continue-on-error: true | |
| - name: Upload Trivy scan results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| if: always() && hashFiles('trivy-results.sarif') != '' | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| continue-on-error: true |