-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (39 loc) · 1.27 KB
/
dart.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Flutter CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Flutter SDK with a specific version that includes Dart SDK >= 3.4.3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.8' # Substitua pela versão que inclui Dart 3.4.3 ou superior
# Cache dependencies
- name: Cache Pub
uses: actions/cache@v3
with:
path: ~/.pub-cache
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.yaml') }}
# Instalar o dotenv para carregar as variáveis do .env
- name: Install dotenv package
run: flutter pub add flutter_dotenv
# Install dependencies
- name: Install dependencies
run: flutter pub get
# Configurar variáveis de ambiente com dotenv
- name: Setup environment variables
run: echo "BASE_URL=${{ secrets.BASE_URL }}" > .env
# Verificar formatação
- name: Verify formatting
run: flutter format --set-exit-if-changed .
# Analyze project source
- name: Analyze project source
run: flutter analyze
# Run tests
- name: Run tests
run: flutter test