-
-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (69 loc) · 2.1 KB
/
interface.yml
File metadata and controls
69 lines (69 loc) · 2.1 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Interface
on:
push:
branches:
- main
paths:
- '.github/workflows/interface.yml'
- 'interface/**/*.dart'
- '!interface/**/*.g.dart'
env:
working-directory: './interface'
jobs:
genfile:
name: Generate file and format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Get dependencies
working-directory: ${{ env.working-directory }}
run: flutter pub get
- name: Run build file
working-directory: ${{ env.working-directory }}
run: dart run build_runner build --delete-conflicting-outputs
- name: Formatting
working-directory: ${{ env.working-directory }}
run: dart format .
- name: Assign Git configurations
run: |
git config --local user.name "rk0cc"
git config --local user.email "enquiry@rk0cc.xyz"
- name: Calculate difference
id: difference
working-directory: ${{ env.working-directory }}
run: git diff --quiet
continue-on-error: true # EXIT CODE 1 MEANS HAS DIFFERENCE
- name: Add and commit generated files
if: steps.difference.outcome == 'failure'
working-directory: ${{ env.working-directory }}
run: |
git add .
git commit -m "Commit gen files"
- name: Push generated files
if: steps.difference.outcome == 'failure'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
unit_test:
name: Unit test
runs-on: ubuntu-latest
needs: genfile
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Get dependencies
working-directory: ${{ env.working-directory }}
run: flutter pub get
- name: Execute test
working-directory: ${{ env.working-directory }}
run: flutter test