diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d810c8e928..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: cirrusci/flutter:stable - - steps: - - checkout - - run: - name: Update submodules - command: | - git submodule init - git submodule update --remote - - - run: - name: Run Flutter doctor - command: flutter doctor - - - run: - name: Link JSON files for API autobuild - command: ./setup.sh - - - restore_cache: - keys: - - android-sdk-licenses - - gradle - - pub-cache - - - run: - name: pub get - command: flutter pub get - - - run: - name: Build step - command: flutter pub run build_runner build --delete-conflicting-outputs - - - run: - name: Run the application tests - command: flutter test --coverage - - # - run: - # name: Upload coverage - # command: | - # bash <(curl -s https://codecov.io/bash) - - - run: - name: Code analysis - command: | - flutter pub global activate tuneup - flutter pub global run tuneup check - - # - run: - # name: Check that the package is ready for publishing - # command: flutter packages pub publish --dry-run - - - run: - name: Check that the package is ready for publishing - command: | - cd example && flutter build apk - - - save_cache: - key: android-sdk-licenses - paths: - - /opt/android-sdk-linux/licenses - - - save_cache: - key: pub-cache - paths: - - /home/cirrus/.pub-cache - - - save_cache: - key: gradle - paths: - - ~/.gradle - - - run: - name: Copy APK - command: | - sudo mkdir -p /artifacts && sudo chown "$(whoami)" /artifacts && cp example/build/app/outputs/apk/release/app-release.apk /artifacts/deriv-api-example.apk - - - store_artifacts: - path: /artifacts diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000000..25d5526100 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,47 @@ +name: Flutter Analyze, Test, and Build + +on: + push: + branches: + - master + - dev + pull_request: + branches: + - "*" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: "ubuntu-latest" + steps: + - name: ๐Ÿ“š Git Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + + - name: ๐Ÿฆ Setup Flutter + uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + flutter-version: "3.10.2" + channel: stable + cache: true + cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + + - name: ๐Ÿ“ฆ Install Dependencies + run: flutter pub get + + # do not fail if the analyze issue is info level + - name: ๐Ÿ•ต๏ธ Analyze + run: | + if flutter analyze 2>&1 | grep -q -E 'error:|warning:'; + then exit 1 + else exit 0 + fi + + - name: ๐Ÿงช Run Tests + run: flutter test + + - name: Build Example app + working-directory: ./example + run: flutter build apk --target-platform android-arm diff --git a/pubspec.yaml b/pubspec.yaml index be7316d9fb..d5ed6f5b18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,9 +16,8 @@ dependencies: deriv_dependency_injector: git: - url: git@github.com:regentmarkets/flutter-deriv-packages.git - path: packages/deriv_dependency_injector - ref: dev + url: https://github.com/deriv-com/deriv-dependency-injector.git + ref: master build: ^2.3.1 dart_style: ^2.3.0