-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (48 loc) · 1.6 KB
/
samples_presubmit.yaml
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
name: Forui Samples Presubmit
on:
workflow_dispatch: {}
pull_request:
branches: [ main ]
paths:
- .github/workflows/samples_presubmit.yaml
pull_request_target:
branches: [ main ]
paths:
- samples/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
if: github.actor != 'auto-maid[bot]' && github.event.pull_request.draft == false
name: Prepare PR for review
runs-on: ubuntu-latest
defaults:
run:
working-directory: samples
steps:
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.AUTO_MAID_APP_ID }}
private_key: ${{ secrets.AUTO_MAID_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: subosito/flutter-action@v2.16.0
with:
cache: true
- run: flutter pub get
- run: flutter pub global activate import_sorter
- run: flutter pub global run import_sorter:main
- run: flutter pub run build_runner build --delete-conflicting-outputs
- run: dart format --line-length 120 .
- run: dart fix --apply
# We format the code again since the required trailing comma lint fixes causes code to be formatted differently
- run: dart format --line-length 120 .
- uses: EndBug/add-and-commit@v9
with:
pull: '--rebase --autostash'
add: '*'