-
Notifications
You must be signed in to change notification settings - Fork 74
102 lines (84 loc) · 2.71 KB
/
quality_control.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Confirm that the code and configuration files
# are correctly formatted and analyzed.
name: quality-control
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
# Cancels the workflow
# when another event in the same context happens.
# If it's a PR, context is the pull request number.
# Otherwise, it uses the Git reference(branch or tag name).
group: >
${{ github.workflow }}
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
code:
name: dart-and-rust-code
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Clippy
run: rustup component add clippy
- name: Install the CLI tool
working-directory: rust_crate/
run: cargo install --path ./
- name: Fetch Flutter dependencies
run: |
flutter pub get --directory flutter_ffi_plugin/
flutter pub get --directory flutter_ffi_plugin/cargokit/build_tool
- name: Generate message files
working-directory: flutter_ffi_plugin/example/
run: rinf message
# Targets are basically combinations of
# web/native and debug/release.
- name: Check for errors in various targets
run: |
rustup target add wasm32-unknown-unknown
cargo clippy
cargo clippy --release
cargo clippy --target wasm32-unknown-unknown
cargo clippy --target wasm32-unknown-unknown --release
# The `--all-features` flag doesn't work for the entire workspace.
# That's why we are checking only the library crate.
- name: Check for errors with all features enabled
working-directory: rust_crate/
run: |
cargo clippy --all-features
cargo clippy --all-features --target wasm32-unknown-unknown
- name: Analyze code
run: |
dart analyze flutter_ffi_plugin --fatal-infos
- name: Format code
run: |
dart format .
cargo fmt
cargo clippy --fix --allow-dirty
- name: Check if the code has changed
run: git diff --exit-code
config:
name: configuration-files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check files with Prettier
uses: creyD/prettier_action@v4.3
with:
dry: True
prettier_options: >
--write
./**/*.{md,yaml}