File tree Expand file tree Collapse file tree 2 files changed +50
-36
lines changed Expand file tree Collapse file tree 2 files changed +50
-36
lines changed Original file line number Diff line number Diff line change @@ -2,23 +2,41 @@ name: Run Test Cases
22
33on :
44 push :
5- branches : [ master ]
5+ branches : [master]
66 pull_request :
7- branches : [ master ]
7+ branches : [master]
88
99jobs :
10- checkout :
10+ check_up_to_date :
1111 name : Checkout Repository
1212 runs-on : ubuntu-latest
1313 steps :
1414 - name : Checkout Code
1515 uses : actions/checkout@v4
16-
17- setup-flutter :
18- name : Setup Flutter
16+ with :
17+ fetch-depth : 0 # Fetch all history so we can compare
18+
19+ - name : Fetch all branches
20+ run : git fetch origin
21+
22+ - name : Check if branch is up-to-date with master
23+ run : |
24+ # Compare the current branch with the master branch
25+ if git merge-base --is-ancestor origin/master HEAD; then
26+ echo "The current branch is up-to-date with master."
27+ else
28+ echo "The current branch is not up-to-date with master."
29+ exit 1
30+ fi
31+
32+ setup_and_test :
33+ name : Setup Flutter and Run Test Cases
1934 runs-on : ubuntu-latest
20- needs : checkout
35+ needs : check_up_to_date
2136 steps :
37+ - name : Checkout Code
38+ uses : actions/checkout@v3
39+
2240 - name : Install Flutter SDK
2341 uses : subosito/flutter-action@v2
2442 with :
2846 - name : Run Flutter doctor
2947 run : flutter doctor -v
3048
31- - name : Checkout Code
32- uses : actions/checkout@v3
33-
3449 - name : Run Flutter Analyzer (Lint)
3550 run : flutter analyze
3651
37- test :
38- name : Run Test Cases
39- runs-on : ubuntu-latest
40- needs : setup-flutter
41- steps :
42- - name : Checkout Code
43- uses : actions/checkout@v3
44-
4552 - name : Run Flutter Tests
46- run : flutter test
53+ run : flutter test
Original file line number Diff line number Diff line change @@ -2,21 +2,39 @@ name: Publish to GitHub Pages
22
33on :
44 push :
5- branches : [ master ]
5+ branches : [master]
66
77jobs :
8- checkout :
8+ check_up_to_date :
99 name : Checkout Repository
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Checkout Code
1313 uses : actions/checkout@v4
14-
15- setup-flutter :
16- name : Setup Flutter
14+ with :
15+ fetch-depth : 0 # Fetch all history so we can compare
16+
17+ - name : Fetch all branches
18+ run : git fetch origin
19+
20+ - name : Check if branch is up-to-date with master
21+ run : |
22+ # Compare the current branch with the master branch
23+ if git merge-base --is-ancestor origin/master HEAD; then
24+ echo "The current branch is up-to-date with master."
25+ else
26+ echo "The current branch is not up-to-date with master."
27+ exit 1
28+ fi
29+
30+ setup_and_deploy :
31+ name : Setup Flutter and Deploy to GitHub Pages
1732 runs-on : ubuntu-latest
18- needs : checkout
33+ needs : check_up_to_date
1934 steps :
35+ - name : Checkout Code
36+ uses : actions/checkout@v3
37+
2038 - name : Install Flutter SDK
2139 uses : subosito/flutter-action@v2
2240 with :
@@ -26,23 +44,12 @@ jobs:
2644 - name : Check Flutter Version
2745 run : flutter --version
2846
29- - name : Checkout Code
30- uses : actions/checkout@v3
31-
3247 - name : Get Flutter Dependencies
3348 run : flutter pub get
3449
3550 - name : Run Flutter Analyzer (Lint)
3651 run : flutter analyze
3752
38- deploy :
39- name : Deploy to GitHub Pages
40- runs-on : ubuntu-latest
41- needs : setup-flutter
42- steps :
43- - name : Checkout Code
44- uses : actions/checkout@v4
45-
4653 - name : Deploy to GitHub Pages
4754 uses : bluefireteam/flutter-gh-pages@v8
4855 with :
You can’t perform that action at this time.
0 commit comments