Skip to content

Commit 1a08569

Browse files
authored
refactor: optimized github actions workflow (#112)
* refactor: optimized github actions workflow * chore: remove not present file paths
1 parent d88870c commit 1a08569

2 files changed

Lines changed: 34 additions & 17 deletions

File tree

.github/workflows/code_quality.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
61
name: Check source code quality
72

83
on:
94
pull_request:
105
branches: ["main"]
6+
paths:
7+
- "**.dart"
8+
- "pubspec.yaml"
9+
- "analysis_options.yaml"
10+
- ".github/workflows/**"
11+
12+
push:
13+
branches: ["main"]
14+
paths:
15+
- "**.dart"
16+
- "pubspec.yaml"
17+
- "analysis_options.yaml"
18+
- ".github/workflows/**"
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
1123

1224
jobs:
1325
lint:
1426
name: Check lints
1527
runs-on: ubuntu-latest
16-
28+
timeout-minutes: 5
1729
steps:
1830
- uses: actions/checkout@v6
1931
- uses: subosito/flutter-action@v2
@@ -22,17 +34,16 @@ jobs:
2234
cache: true
2335
- run: flutter --version
2436

25-
# Get flutter dependencies.
2637
- name: Install dependencies
2738
run: flutter pub get
2839

29-
# Check for any formatting issues in the code.
3040
- name: Verify formatting
3141
run: dart format --set-exit-if-changed .
3242

3343
analyze:
3444
name: Check code analysis
3545
runs-on: ubuntu-latest
46+
timeout-minutes: 5
3647
steps:
3748
- uses: actions/checkout@v6
3849
- uses: subosito/flutter-action@v2
@@ -41,10 +52,8 @@ jobs:
4152
cache: true
4253
- run: flutter --version
4354

44-
# Get flutter dependencies.
4555
- name: Install dependencies
4656
run: flutter pub get
4757

48-
# Statically analyze the Dart code for any errors.
4958
- name: Analyze project source
5059
run: flutter analyze .

.github/workflows/unit_tests.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
61
name: Unit tests
72

83
on:
94
pull_request:
105
branches: ["main"]
6+
paths:
7+
- "**.dart"
8+
- "pubspec.yaml"
9+
- ".github/workflows/**"
10+
1111
push:
1212
branches: ["main"]
13+
paths:
14+
- "**.dart"
15+
- "pubspec.yaml"
16+
- ".github/workflows/**"
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
1321

1422
jobs:
1523
unit_test:
1624
name: Run unit tests
1725
runs-on: ubuntu-latest
26+
timeout-minutes: 5
27+
1828
steps:
1929
- uses: actions/checkout@v6
2030
- uses: subosito/flutter-action@v2
@@ -23,10 +33,8 @@ jobs:
2333
cache: true
2434
- run: flutter --version
2535

26-
# Get flutter dependencies.
2736
- name: Install dependencies
2837
run: flutter pub get
2938

30-
# Run the unit tests.
3139
- name: Run unit tests
3240
run: flutter test

0 commit comments

Comments
 (0)