Skip to content

Commit b1d98d9

Browse files
Add action to run tests and perform analysis on PRs
1 parent 810a874 commit b1d98d9

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
paths-ignore:
8+
- '.github/**'
9+
- '.vscode/**'
10+
- 'README.md'
11+
push:
12+
branches:
13+
- dev
14+
paths-ignore:
15+
- '.github/**'
16+
- '.vscode/**'
17+
- 'README.md'
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Setup Flutter
26+
- uses: subosito/flutter-action@v2
27+
with:
28+
flutter-version: '2.10.4'
29+
channel: 'stable'
30+
- run: flutter doctor -v
31+
32+
- name: Checkout OneSignal-Flutter-SDK
33+
uses: actions/checkout@v3
34+
run: flutter pub get
35+
36+
# - name: Cache Flutter packages
37+
# uses: actions/cache@v3
38+
# with:
39+
# path: ~/.pub-cache/hosted/pub.dartlang.org
40+
41+
# key: ${{ runner.OS }}-flutter-${{ hashFiles('**/pubspec.lock') }}
42+
# restore-keys: |
43+
# ${{ runner.os }}-build-${{ env.cache-name }}-
44+
# ${{ runner.os }}-build-
45+
# ${{ runner.os }}-
46+
47+
- name: Static Analysis
48+
run: flutter analyze
49+
50+
- name: Ensure the Dart code is formatted correctly
51+
run: flutter format --set-exit-if-changed --dry-run .
52+
53+
- name: Run Flutter unit tests
54+
run: flutter test

0 commit comments

Comments
 (0)