Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

About Git Actions

GitHub Actions enables you to create custom software development lifecycle workflows
directly in your GitHub repository. This enables you to include Continues
Integration (CI) and continuous deployment (CD) capabilities. it easier to automate how you build, test,
and deploy your projects on any platform, including Linux, macOS, and Windows.
Run your workflows in a virtual machine.

Why to use Git Action

  • It is easy to build the app in artifacts.

  • Analyze, Build, Test and Deploy our applications on any platform.

  • Easily release the app bundle in the Play store.

  • The speed of GitHub Actions is good

Reference link

File Path

Primary Files https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/SelectLanguage/languageSelection.dart

Integrating GitHub actions in Project

  • Every command will be written in yml files and all these files will be in .github/workflows/ directory
    of your repository, then only git will identify our script files.

  • In our repository we are maintaining this file as main.yml, In this yml file we are executing the android drive job, which will
    run the integration testing scripts, once all the tests are passed then only it will build the app in QA ENV and store in artifacts as shown image.

  • Explained every line of main.yml file with comments below

# Name of your workflow.
name: integration-test

# Trigger the workflow on push or pull requests.
on:
  push:
    branches: [ IFIX-732 ]

# A workflow run is made up of one or more jobs.
jobs:
  # id of job, a string that is unique to the "jobs" node above.
  drive_android:
    # The type of machine to run the job on.
    runs-on: ubuntu-latest
    # Creates a build matrix for your jobs. You can define different
    # variations of an environment to run each job in.
    strategy:
      # A set of different configurations of the virtual  
      # environment.
      matrix:
        api-level: [ 30 ]
        target: [ default ]
    # Contains a sequence of tasks.
    steps:
      # The branch or tag ref that triggered the workflow will be 
      # checked out.
      - uses: actions/checkout@v2
      # Sets up a java environment.
      - uses: actions/setup-java@v1
        with:
          java-version: '1.8.x'
      # Sets up a Flutter environment.
      - uses: subosito/flutter-action@v1
        with:
          flutter-version: '2.5.2'
          channel: 'stable'
      - name: "Run Flutter Driver tests"
        #Operation for installing, configuring and running Android emulator
        # https://github.com/marketplace/actions/android-emulator-runner
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          target: ${{ matrix.target }}
          arch: x86_64
          profile: Nexus 6
          script: "cd ./frontend/mgramseva && flutter drive  --dart-define=BASE_PATH=https://mgramseva-qa.egov.org.in/
          --driver=test_driver/integration_test_driver.dart   --target=integration_test/login_test.dart"
      # checking out to respective directory and building the apk
      - name: "flutter pub get"
        run: cd ./frontend/mgramseva && flutter build apk
      # uploading the release build to artifact
      - uses: actions/upload-artifact@v1
        with:
          name: release-apk
          path: frontend/mgramseva/build/app/outputs/apk/release/app-release.apk

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.