From 97762f92cc33e22ad57e7b15626581421ca0f5a6 Mon Sep 17 00:00:00 2001 From: Nikhil Rajput Date: Sun, 8 Sep 2024 19:11:17 +0530 Subject: [PATCH] bumped to version 3.0.0 --- .github/workflows/test.yml | 45 ++++++++++++++++++++++---------------- .github/workflows/web.yml | 41 ++++++++++++++++++++-------------- 2 files changed, 50 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 356bf65..a48db10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,23 +2,41 @@ name: Run Test Cases on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: - checkout: + check_up_to_date: name: Checkout Repository runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 - - setup-flutter: - name: Setup Flutter + with: + fetch-depth: 0 # Fetch all history so we can compare + + - name: Fetch all branches + run: git fetch origin + + - name: Check if branch is up-to-date with master + run: | + # Compare the current branch with the master branch + if git merge-base --is-ancestor origin/master HEAD; then + echo "The current branch is up-to-date with master." + else + echo "The current branch is not up-to-date with master." + exit 1 + fi + + setup_and_test: + name: Setup Flutter and Run Test Cases runs-on: ubuntu-latest - needs: checkout + needs: check_up_to_date steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Install Flutter SDK uses: subosito/flutter-action@v2 with: @@ -28,19 +46,8 @@ jobs: - name: Run Flutter doctor run: flutter doctor -v - - name: Checkout Code - uses: actions/checkout@v3 - - name: Run Flutter Analyzer (Lint) run: flutter analyze - test: - name: Run Test Cases - runs-on: ubuntu-latest - needs: setup-flutter - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - name: Run Flutter Tests - run: flutter test \ No newline at end of file + run: flutter test diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 7187440..910de25 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -2,21 +2,39 @@ name: Publish to GitHub Pages on: push: - branches: [ master ] + branches: [master] jobs: - checkout: + check_up_to_date: name: Checkout Repository runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 - - setup-flutter: - name: Setup Flutter + with: + fetch-depth: 0 # Fetch all history so we can compare + + - name: Fetch all branches + run: git fetch origin + + - name: Check if branch is up-to-date with master + run: | + # Compare the current branch with the master branch + if git merge-base --is-ancestor origin/master HEAD; then + echo "The current branch is up-to-date with master." + else + echo "The current branch is not up-to-date with master." + exit 1 + fi + + setup_and_deploy: + name: Setup Flutter and Deploy to GitHub Pages runs-on: ubuntu-latest - needs: checkout + needs: check_up_to_date steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Install Flutter SDK uses: subosito/flutter-action@v2 with: @@ -26,23 +44,12 @@ jobs: - name: Check Flutter Version run: flutter --version - - name: Checkout Code - uses: actions/checkout@v3 - - name: Get Flutter Dependencies run: flutter pub get - name: Run Flutter Analyzer (Lint) run: flutter analyze - deploy: - name: Deploy to GitHub Pages - runs-on: ubuntu-latest - needs: setup-flutter - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - name: Deploy to GitHub Pages uses: bluefireteam/flutter-gh-pages@v8 with: