Release: 2.24.0 (#138) #541
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+*' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| format: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check format | |
| run: scripts/check_format.sh | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Lint using flutter analyze | |
| run: flutter analyze | |
| - name: Assert that every file that should be public has been exported | |
| run: scripts/assert_export.sh | |
| pub-dry-run: | |
| name: Publish Dry Run | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Run publish dry run | |
| run: flutter pub publish --dry-run | |
| test-flutter: | |
| name: Test Flutter | |
| needs: [ lint, format, pub-dry-run ] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Run all tests | |
| run: flutter test --reporter=expanded --coverage | |
| - name: Check coverage | |
| run: dart scripts/check_coverage.dart coverage/lcov.info | |
| test-android: | |
| name: Test Android | |
| needs: [ lint, format, pub-dry-run ] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| env: | |
| GRADLE_VERSION: 8.7 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache Gradle | |
| id: cache-gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ./example/android/ci-cache/gradle | |
| ./example/android/gradle/wrapper/gradle-wrapper.jar | |
| ./example/android/gradlew | |
| key: ${{ runner.os }}-cache-gradle-${{ env.GRADLE_VERSION }} | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Setup Gradle | |
| if: steps.cache-gradle.outputs.cache-hit != 'true' | |
| working-directory: ./example/android | |
| run: ../../scripts/setup_gradle.sh ${{ env.GRADLE_VERSION }} | |
| - name: Validate Gradle | |
| working-directory: ./example/android | |
| run: dart ../../scripts/check_gradle_version.dart | |
| - name: Run all tests | |
| working-directory: ./example/android | |
| run: ./gradlew :usercentrics_sdk:test | |
| test-ios: | |
| name: Test iOS | |
| needs: [ lint, format, pub-dry-run ] | |
| runs-on: macos-13 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Setup code | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '14.2' | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.22.3' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Setup Pods | |
| working-directory: ./example/ios | |
| run: pod install | |
| - name: Run all tests | |
| working-directory: ./example/ios | |
| run: ../../scripts/ios_unit_tests.sh | |
| build-android: | |
| name: Build Android Example | |
| needs: [ lint, format, pub-dry-run ] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build | |
| working-directory: ./example | |
| run: flutter build apk | |
| build-ios: | |
| name: Build iOS Example | |
| needs: [ lint, format, pub-dry-run ] | |
| runs-on: macos-13 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Setup code | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '14.2' | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.22.3' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build | |
| working-directory: ./example | |
| run: flutter build ios --debug --no-codesign --simulator | |
| # https://dart.dev/tools/pub/automated-publishing | |
| release: | |
| name: Release | |
| permissions: | |
| id-token: write | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [ test-flutter, test-android, test-ios, build-android, build-ios ] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cirruslabs/flutter:3.22.3 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Validate version | |
| run: dart scripts/check_release_version.dart ${{ github.ref }} | |
| - name: Set publishing token | |
| uses: dart-lang/setup-dart@v1 | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Publish | |
| run: flutter pub publish -f |