Update README.md #19
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: Swift | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| # Only run documentation deployment on main branch | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build | |
| run: swift build -v | |
| - name: Run tests | |
| run: swift test -v | |
| - name: Resolve Package Dependencies | |
| run: swift package resolve | |
| - name: Generate Documentation | |
| run: | | |
| # Clean up any existing documentation artifacts | |
| rm -rf ./.build/plugins/Swift-DocC/outputs/PartialJSON.doccarchive | |
| mkdir -p ./docs | |
| swift package generate-documentation \ | |
| --target PartialJSON \ | |
| --disable-indexing \ | |
| --transform-for-static-hosting \ | |
| --hosting-base-path PartialJSON | |
| continue-on-error: false | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./.build/plugins/Swift-DocC/outputs/PartialJSON.doccarchive | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| lint: | |
| name: SwiftLint | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint --strict | |
| validate-documentation: | |
| name: Validate Documentation | |
| runs-on: macos-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode 26 | |
| run: sudo xcode-select -s /Applications/Xcode_26.0.app/Contents/Developer | |
| - name: Setup Swift 5.9 | |
| uses: SwiftyLab/setup-swift@latest | |
| with: | |
| swift-version: '5.9' | |
| - name: Resolve Package Dependencies | |
| run: swift package resolve | |
| - name: Validate Documentation | |
| run: | | |
| swift package generate-documentation \ | |
| --target PartialJSON \ | |
| --disable-indexing |