-
Notifications
You must be signed in to change notification settings - Fork 50
131 lines (103 loc) · 4.52 KB
/
dart.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: dart
permissions: read-all
on:
pull_request:
branches: [main]
paths:
- ".github/workflows/dart.yaml"
- "pkgs/**"
push:
branches: [main]
paths:
- ".github/workflows/dart.yaml"
- "pkgs/**"
schedule:
- cron: "0 0 * * 0" # weekly
jobs:
build:
strategy:
matrix:
os: [ubuntu, macos, windows]
sdk: [stable, dev]
package: [native_assets_builder, native_assets_cli, native_toolchain_c]
# Breaking changes temporarily break the example run on the Dart SDK until native_assets_builder is rolled into the Dart SDK dev build.
breaking-change: [false]
exclude:
# Only run analyze against dev on one host.
- os: macos
sdk: dev
- os: windows
sdk: dev
runs-on: ${{ matrix.os }}-latest
defaults:
run:
working-directory: pkgs/${{ matrix.package }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: ${{ matrix.sdk }}
- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b
if: ${{ matrix.sdk == 'stable' }}
- run: dart pub get
- run: dart pub get -C test/data/dart_app/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C test/data/native_add/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C test/data/native_add_add_source/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C test/data/native_subtract/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C test/data/package_reading_metadata/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C test/data/package_with_metadata/
if: ${{ matrix.package == 'native_assets_builder' }}
- run: dart pub get -C example/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' }}
- run: dart pub get -C example/native_add_library/
if: ${{ matrix.package == 'native_assets_cli' }}
- run: dart analyze --fatal-infos
# Run on dev to ensure we're not depending on deprecated SDK things.
- run: dart format --output=none --set-exit-if-changed .
if: ${{ matrix.sdk == 'stable' }}
- name: Install native toolchains
run: sudo apt-get update && sudo apt-get install clang-14 gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
if: ${{ matrix.sdk == 'stable' && matrix.os == 'ubuntu' }}
- run: dart test
if: ${{ matrix.sdk == 'stable' }}
- run: dart --enable-experiment=native-assets test
working-directory: pkgs/${{ matrix.package }}/example/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
- run: dart --enable-experiment=native-assets run
working-directory: pkgs/${{ matrix.package }}/example/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
- run: dart --enable-experiment=native-assets build bin/native_add_app.dart
working-directory: pkgs/${{ matrix.package }}/example/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
- run: ./native_add_app.exe
working-directory: pkgs/${{ matrix.package }}/example/native_add_app/bin/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
- name: Install coverage
run: dart pub global activate coverage
if: ${{ matrix.sdk == 'stable' }}
- name: Collect coverage
run: dart pub global run coverage:test_with_coverage
if: ${{ matrix.sdk == 'stable' }}
- name: Upload coverage
uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474
with:
flag-name: ${{ matrix.package }}-${{ matrix.os }}
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
if: ${{ matrix.sdk == 'stable' }}
coverage-finished:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Upload coverage
uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true