Skip to content

Commit

Permalink
Update pull-request.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
palisadoes authored Jan 3, 2025
1 parent 4a1fd19 commit 918eb7e
Showing 1 changed file with 102 additions and 80 deletions.
182 changes: 102 additions & 80 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,85 +93,6 @@ jobs:
echo "Error: Close this PR and try again."
exit 1
# - name: Echo the GitHub environment for troubleshooting
# run: echo "$GITHUB_CONTEXT"
# - name: Echo the GitHub context for troubleshooting
# run: echo "${{ toJSON(github) }}"
# - name: setup python
# uses: actions/setup-python@v5
# - name: Granting permission to documentationcheck.py
# run: chmod +x ./.github/workflows/documentationcheck.py
# - name: execute py script
# # For more information on the GitHub context used for the "--repository" flag used by this script visit:
# # https://docs.github.com/en/actions/learn-github-actions/contexts
# run: |
# git branch
# pip install GitPython
# python ./.github/workflows/documentationcheck.py --repository ${{github.repository}} --merge_branch_name ${{github.ref_name}}

Flutter-Testing:
name: Testing codebase
runs-on: ubuntu-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu" # See 'Supported distributions' for available options
java-version: "17.0"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Codebase testing
run: flutter test --coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: false
name: "${{env.CODECOV_UNIQUE_NAME}}"
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: "./coverage/lcov.info"
min_coverage: 92.0

Android-Build:
name: Testing build for android
runs-on: ubuntu-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu" # See 'Supported distributions' for available options
java-version: "17.0"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Building for android
run: flutter build apk

iOS-Build:
name: Testing build for iOS
runs-on: macos-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
architecture: x64
- name: Building for ios
run: flutter build ios --release --no-codesign
Branch-check:
if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }}
Expand All @@ -192,7 +113,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Changed Unauthorized files
id: changed-unauth-files
uses: tj-actions/changed-files@v45
Expand Down Expand Up @@ -251,3 +171,105 @@ jobs:
echo "- Contributor may be merging into an incorrect branch."
echo "- Source branch may be incorrect please use develop as source branch."
exit 1
Flutter-Testing:
name: Testing codebase
runs-on: ubuntu-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu" # See 'Supported distributions' for available options
java-version: "17.0"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Codebase testing
run: flutter test --coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: false
name: "${{env.CODECOV_UNIQUE_NAME}}"
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: "./coverage/lcov.info"
min_coverage: 92.0

Android-Build:
name: Testing build for android
runs-on: ubuntu-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu" # See 'Supported distributions' for available options
java-version: "17.0"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
- name: Building for android
run: flutter build apk

iOS-Build:
name: Testing build for iOS
runs-on: macos-latest
needs: Flutter-Codebase-Check
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
channel: "stable" # or: 'beta', 'dev' or 'master'
architecture: x64
- name: Building for ios
run: flutter build ios --release --no-codesign

Test-Docusaurus-Deployment:
name: Test Deployment to https://docs-mobile.talawa.io
runs-on: ubuntu-latest
needs: [iOS-Build, Android-Build]
# Run only if the develop-postgres branch and not dependabot
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
cache-dependency-path: 'docs/'
# Run Docusaurus in the ./docs directory
- name: Install dependencies
working-directory: ./docs
run: yarn install --frozen-lockfile
- name: Test building the website
working-directory: ./docs
run: yarn build

Validate-Coderabbit:
name: Validate CodeRabbit Approval
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
needs: [Test-Docusaurus-Deployment]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate CodeRabbit.ai Approval
run: |
chmod +x $GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
$GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}

0 comments on commit 918eb7e

Please sign in to comment.