-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (70 loc) · 2.76 KB
/
build_and_test.yml
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
name: Build and test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Set up Dart SDK
uses: dart-lang/[email protected]
with:
sdk: stable
- name: 📦 Setup Visual Studio Code
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo snap install code --classic
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew install --cask visual-studio-code
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install vscode
fi
shell: bash
- name: ✔️ Verify Visual Studio Code installation
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
/snap/bin/code --version
elif [[ "${{ runner.os }}" == "macOS" ]]; then
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" --version
elif [[ "${{ runner.os }}" == "Windows" ]]; then
"C:\\Program Files\\Microsoft VS Code\\bin\\code" --version
fi
shell: bash
- name: 📦 Setup Android Studio
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo snap install android-studio --classic
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew install --cask android-studio
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install androidstudio
fi
shell: bash
- name: ✔️ Verify Android Studio installation
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
/snap/bin/android-studio --version
elif [[ "${{ runner.os }}" == "macOS" ]]; then
"/Applications/Android Studio.app/Contents/MacOS/studio" --version
elif [[ "${{ runner.os }}" == "Windows" ]]; then
"C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe" --version
fi
shell: bash
- name: 📦 Install Dependencies
run: |
dart pub global activate coverage
dart pub get
- name: ✨ Check Formatting
run: dart format --set-exit-if-changed .
- name: 🕵️ Analyze
run: dart analyze .
- name: 🧪 Run Tests
run: dart run test --coverage=./coverage && dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage
- name: ⬆️ Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}