-
Notifications
You must be signed in to change notification settings - Fork 271
97 lines (94 loc) · 3.31 KB
/
dart.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Dart
on:
# Run CI on pushes to the master branch, and on PRs against master.
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 0 * * 0"
jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [3.5, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- name: Report version
run: dart --version
- name: Install dependencies
run: dart pub get
- name: Check formatting (using dev dartfmt release)
if: ${{ matrix.sdk == 'dev' }}
run: dart format --output=none --set-exit-if-changed .
- name: Analyze code (introp and examples)
run: |
for example in interop example/*/; do
pushd $example
echo [Getting dependencies in $example]
dart pub get
popd
done
shell: bash
- name: Analyze code
run: dart analyze --fatal-infos .
- name: Check that grpc-web sample builds with DDC
if: ${{ matrix.sdk == 'dev' }}
# build_runner build --no-release to force compilation with DDC.
run: |
pushd example/grpc-web
rm -rf build
dart pub run build_runner build --no-release -o web:build
test -f ./build/main.dart.js
popd
# Run tests on a matrix consisting of three dimensions:
# 1. OS: mac, windows, linux
# 2. release channel: dev
# 3. TODO: Dart execution mode: native, web
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [3.5, dev]
platform: [vm, chrome]
exclude:
# We only run Chrome tests on Linux. No need to run them
# on Windows and Mac because they are platform independent.
- os: windows-latest
platform: chrome
- os: macos-latest
platform: chrome
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- name: Report version
run: dart --version
- name: Install envoy
if: ${{ matrix.platform == 'chrome' }}
run: |
ENVOY_VERSION="1.19.0"
wget https://archive.tetratelabs.io/envoy/download/v${ENVOY_VERSION}/envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz
tar -xf envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz
chmod +x envoy-v${ENVOY_VERSION}-linux-amd64/bin/envoy
sudo mv envoy-v${ENVOY_VERSION}-linux-amd64/bin/envoy /usr/bin/envoy
rm -rf envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz envoy-v${ENVOY_VERSION}-linux-amd64
env:
MATRIX_OS: ${{ matrix.os }}
shell: bash
- name: Install dependencies
run: dart pub get
- name: Run tests
run: dart test --platform ${{ matrix.platform }}
- name: Run vmservice test
if: ${{ matrix.platform != 'chrome' }}
run: dart run --enable-vm-service --timeline-streams=Dart test/timeline_test.dart