Simplified CI #12
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 ] | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| 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: | | |
| swift package generate-documentation \ | |
| --target PartialJSON \ | |
| --disable-indexing \ | |
| --transform-for-static-hosting \ | |
| --hosting-base-path PartialJSON \ | |
| --output-path ./docs | |
| continue-on-error: false | |
| - name: Upload Documentation to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| 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 | |
| documentation: | |
| name: Generate Documentation | |
| runs-on: macos-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: [build, lint] | |
| 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' | |
| 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 |