Skip to content

Commit cc5abbb

Browse files
committed
Add CI workflow and fix Flutter setup for CodeQL
Run analyze and tests on pushes and pull requests, and update the CodeQL workflow so Flutter setup works reliably on GitHub Actions.
1 parent 1c28691 commit cc5abbb

2 files changed

Lines changed: 44 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Flutter CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Analyze and Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Java
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: '17'
23+
24+
- name: Setup Flutter
25+
uses: subosito/flutter-action@v2
26+
with:
27+
channel: stable
28+
cache: true
29+
30+
- name: Install dependencies
31+
run: flutter pub get
32+
33+
- name: Analyze
34+
run: flutter analyze
35+
36+
- name: Run tests
37+
run: flutter test

.github/workflows/codeql.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,25 @@ jobs:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
2929

30+
- name: Set up Java
31+
uses: actions/setup-java@v4
32+
with:
33+
distribution: temurin
34+
java-version: '17'
35+
3036
- name: Initialize CodeQL
3137
uses: github/codeql-action/init@v3
3238
with:
3339
languages: ${{ matrix.language }}
3440

35-
# Install Flutter
3641
- name: Setup Flutter
3742
uses: subosito/flutter-action@v2
3843
with:
39-
flutter-version: 'stable'
44+
channel: stable
4045

4146
- name: Install dependencies
4247
run: flutter pub get
4348

44-
# Manual build (ovo rešava CodeQL problem)
4549
- name: Build Android
4650
run: flutter build apk --debug
4751

0 commit comments

Comments
 (0)