Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitAuto: Add github actions to automatically conduct flutter test on pull request creation and push event to non-default branch #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gitauto-for-dev[bot]
Copy link

@gitauto-for-dev gitauto-for-dev bot commented Feb 13, 2025

Resolves #2

Why is this feature needed?

To ensure code quality and catch potential issues early, it's crucial to run automated tests on pull request creation and on pushes to non-default branches. This continuous integration setup provides immediate feedback to developers and maintains the stability of the master branch.

What and how are we changing? Why this approach?

We have added a new GitHub Actions workflow file (.github/workflows/flutter_test.yml) that:

  • Runs tests automatically on pull request events targeting the default branch (master).
  • Executes tests on pushes made to non-default branches.

This approach leverages GitHub Actions to automate the test suite using the stable version of Flutter. It helps maintain a consistent and reliable testing pipeline without requiring manual intervention.

What actions are required from users?

No immediate actions are required from users. The workflow is automatically triggered on pull request creation and on pushes to non-master branches. Developers should ensure that their branches are named correctly (i.e., non-default branches for automated testing on push events).

How does it work? (Technical details)

  • The trigger is set to run on pull request events targeting the master branch and on push events for branches not equal to master.
  • The job is executed on an Ubuntu environment.
  • The workflow checks out the repository using the actions/checkout@v2.
  • It sets up the Flutter environment with subosito/flutter-action@v2 using the stable version.
  • It acquires necessary dependencies with "flutter pub get".
  • Finally, it runs the entire test suite with "flutter test".

By setting up the workflow in this manner, we ensure that the Flutter tests are executed reliably in a continuous integration environment.

Is it backwards compatible?

Yes, this addition is fully backwards compatible. It only introduces a new workflow file and does not modify any existing functionality or configurations.

Any other considerations?

  • Ensure that the branch names are properly maintained (master as the default branch and other branches for development) to avoid unexpected behavior with workflow triggers.
  • Monitor the GitHub Actions workflow logs periodically to verify that the tests are running as expected and to catch any issues early.

This setup enhances our development process by automating test runs, reducing potential errors, and maintaining overall code quality.

git fetch origin
git checkout gitauto-wes/issue-2-20250213-143722
git pull origin gitauto-wes/issue-2-20250213-143722

Copy link
Author

gitauto-for-dev bot commented Feb 13, 2025

Committed the Check Run test error fix! Running it again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
0 participants