Merge pull request #454 from Raster-Lab/v10.18.0-release-candidate #898
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: Code Quality | |
| on: | |
| push: | |
| branches: [ main, develop, 'release/*' ] | |
| pull_request: | |
| branches: [ main, develop, 'release/*' ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| # v8.1.1 — opt into Node 24 for JS-based actions; see release.yml note. | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| jobs: | |
| swiftlint: | |
| name: SwiftLint | |
| runs-on: macos-15 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: | | |
| OUTPUT=$(swiftlint lint 2>&1) || true | |
| echo "$OUTPUT" | |
| if echo "$OUTPUT" | grep -q ': error:'; then | |
| echo "::error::SwiftLint found error-level violations" | |
| exit 1 | |
| fi | |
| - name: Generate SwiftLint report | |
| if: always() | |
| run: | | |
| swiftlint lint --reporter json > swiftlint-report.json || true | |
| - name: Upload SwiftLint results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: swiftlint-report | |
| path: swiftlint-report.json | |
| security-audit: | |
| name: Security Audit | |
| runs-on: macos-15 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Swift | |
| uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: '6.2' | |
| - name: Check for known vulnerabilities | |
| run: | | |
| # Resolve dependencies | |
| swift package resolve | |
| # List all dependencies | |
| swift package show-dependencies | |
| - name: Verify Package.swift | |
| run: swift package dump-package | |
| code-coverage: | |
| name: Code Coverage | |
| runs-on: macos-15 | |
| timeout-minutes: 75 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Swift | |
| uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: '6.2' | |
| - name: Run tests with coverage | |
| continue-on-error: true | |
| run: | | |
| swift test --enable-code-coverage --parallel \ | |
| --skip Benchmark \ | |
| --skip Stress \ | |
| --skip Diagnostic \ | |
| --skip Fuzz \ | |
| --skip PerformanceTuning \ | |
| --skip LargeBlock \ | |
| --skip EndToEnd \ | |
| --skip ClientServer | |
| timeout-minutes: 60 | |
| - name: Generate coverage report | |
| run: | | |
| BIN_PATH=$(swift build --show-bin-path) | |
| XCTEST_PATH=$(find "${BIN_PATH}" -name '*.xctest' -type d 2>/dev/null | head -1) | |
| if [ -n "${XCTEST_PATH}" ]; then | |
| EXEC_PATH="${XCTEST_PATH}/Contents/MacOS/$(basename "${XCTEST_PATH}" .xctest)" | |
| echo "Found xctest bundle: ${XCTEST_PATH}" | |
| else | |
| EXEC_PATH=$(find "${BIN_PATH}" -name 'J2KSwiftPackageTests' -type f 2>/dev/null | head -1) | |
| echo "Using fallback binary: ${EXEC_PATH}" | |
| fi | |
| PROFDATA=$(find .build -name 'default.profdata' -type f 2>/dev/null | head -1) | |
| if [ -n "${EXEC_PATH}" ] && [ -n "${PROFDATA}" ]; then | |
| echo "Generating coverage from: ${EXEC_PATH}" | |
| xcrun llvm-cov export -format="lcov" "${EXEC_PATH}" -instr-profile "${PROFDATA}" > coverage.lcov | |
| else | |
| echo "Could not find test binary or profdata for coverage report" | |
| fi | |
| - name: Upload coverage to artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.lcov | |
| if-no-files-found: warn | |
| validation: | |
| name: Package Validation | |
| runs-on: macos-15 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Swift | |
| uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: '6.2' | |
| - name: Validate Swift package | |
| run: | | |
| swift package describe | |
| swift package dump-package | |
| - name: Check for Swift format | |
| run: | | |
| # Check if swift-format is available | |
| if command -v swift-format &> /dev/null; then | |
| swift-format lint -r Sources Tests || true | |
| else | |
| echo "swift-format not available, skipping" | |
| fi |