Skip to content

Commit 1bd7306

Browse files
authored
Add github actions script
1 parent e7f534b commit 1bd7306

File tree

2 files changed

+47
-28
lines changed

2 files changed

+47
-28
lines changed

.github/workflows/flutter.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Flutter CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master # Runs on pushes to the main branch
7+
pull_request:
8+
branches:
9+
- '**' # Runs on all pull requests
10+
11+
jobs:
12+
flutter-test:
13+
name: Run Flutter Tests
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Step 1: Checkout the code
18+
- name: Checkout Code
19+
uses: actions/checkout@v3
20+
21+
# Step 2: Set up Flutter
22+
- name: Setup Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: 3.13.0
26+
27+
# Step 3: Precache Dependencies
28+
- name: Flutter Precache
29+
run: flutter precache
30+
31+
# Step 4: Run Flutter Doctor (Optional, for Debugging)
32+
- name: Flutter Doctor
33+
run: flutter doctor
34+
35+
# Step 5: Run Tests
36+
- name: Run Tests
37+
run: flutter test
38+
39+
# Cache dependencies
40+
- name: Cache Pub Dependencies
41+
uses: actions/cache@v3
42+
with:
43+
path: ~/.pub-cache
44+
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pub-cache-
47+

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)