Add Swift SDK generation and release checks #413
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: Check submodules | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the main branch | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check-submodules: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: true | |
| - name: Check all submodules up-to-date | |
| working-directory: ${{ github.workspace }} | |
| env: | |
| SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }} | |
| run: | | |
| bash scripts/checkout-submodules.bash --remote | |
| git diff --exit-code | |
| check-swagger: | |
| runs-on: ubuntu-latest | |
| needs: [check-submodules] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check existing swagger specification is up-to-date | |
| run: curl https://api.aspose.cloud/v4.0/barcode/swagger/spec | diff --strip-trailing-cr -y --suppress-common-lines spec/aspose-barcode-cloud.json - | |
| check-swift-codegen-linux: | |
| runs-on: ubuntu-latest | |
| needs: [check-submodules] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Checkout submodules | |
| working-directory: ${{ github.workspace }} | |
| env: | |
| SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }} | |
| run: bash scripts/checkout-submodules.bash | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: corretto | |
| java-version: 21 | |
| - name: Show Swift version | |
| run: swift --version | |
| - name: Regenerate Swift SDK | |
| run: make swift | |
| - name: Check Swift SDK generation is reproducible | |
| run: git diff --exit-code | |
| - name: Build Swift example | |
| working-directory: submodules/swift | |
| run: swift build --product GenerateAndScanExample | |
| - name: Run Swift live integration tests | |
| working-directory: submodules/swift | |
| run: make integration-test | |
| env: | |
| TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }} | |
| check-swift-macos: | |
| runs-on: macos-latest | |
| needs: [check-swift-codegen-linux] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Checkout submodules | |
| working-directory: ${{ github.workspace }} | |
| env: | |
| SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }} | |
| run: bash scripts/checkout-submodules.bash | |
| - name: Show Swift version | |
| run: swift --version | |
| - name: Build Swift SDK | |
| working-directory: submodules/swift | |
| run: make build | |
| - name: Run Swift tests | |
| working-directory: submodules/swift | |
| run: make test | |
| - name: Build Swift example | |
| working-directory: submodules/swift | |
| run: swift build --product GenerateAndScanExample |