diff --git a/.github/workflows/android-tests.yml b/.github/workflows/android-tests.yml new file mode 100644 index 0000000..65cc848 --- /dev/null +++ b/.github/workflows/android-tests.yml @@ -0,0 +1,43 @@ +name: Tests + +on: + pull_request: + branches: + - '*' + +jobs: + android_build_and_test: + name: Android - run tests + runs-on: ubuntu-22.04 + env: + isCI: "true" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: "17" + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.3 + + - name: Add current platform to Bundler lockfile + run: | + bundle lock --add-platform ruby + bundle lock --add-platform x86_64-linux + + - name: Install Gems + run: bundle install + + - name: Run Tests + run: bundle exec fastlane test + env: + BASE_URL: ${{ secrets.BASE_URL_DEBUG }} diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 132186f..0000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build and test - -on: - pull_request: - branches: - - '*' - -jobs: - android_build_and_test: - name: Android - build and test - runs-on: ubuntu-22.04 - env: - isCI: "true" - BASE_SCHEME: ${{ secrets.BASE_URL_DEBUG }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: "17" - - - name: Create local.properties - run: echo "BASE_URL=${BASE_SCHEME}" >> local.properties - - - name: Build android - run: ./gradlew assembleDebug --stacktrace diff --git a/fastlane/Fastfile b/fastlane/Fastfile index da5f2ec..9bb8f5d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -20,7 +20,15 @@ QA = "QA" platform :android do desc "Runs all the tests" lane :test do - gradle(task: "test") + # Function: + # This lane run tests with properties BASE_URL + gradle( + task: "test", + print_command: false, + properties: { + "BASE_URL" => ENV['BASE_URL'] + } + ) end desc "Build and Deploy QA version on Firebase App Distribution"