-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (108 loc) · 3.62 KB
/
ci.yml
File metadata and controls
131 lines (108 loc) · 3.62 KB
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: CI
on:
pull_request:
branches: [main]
env:
MIN_COVERAGE: ${{ vars.MIN_COVERAGE }}
SERVER_BINARY: build/bin/server_node.js
jobs:
website:
name: Website Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ vars.DART_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: website/package-lock.json
- name: Install dependencies
working-directory: website
run: npm ci
- name: Get Playwright version
id: playwright-version
working-directory: website
run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: website
run: npx playwright install --with-deps chromium
- name: Install Playwright deps only (cached)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Build website
working-directory: website
run: npm run build
- name: Run tests
working-directory: website
run: npm test
packages:
name: Lint, Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
dart-version: ${{ vars.DART_VERSION }}
- name: Install tools
run: |
npm install -g cspell
dart pub global activate coverage
- name: Get all dependencies
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::$dir"
cd $dir && dart pub get && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Install npm dependencies
run: |
for dir in packages/* examples/*; do
if [ -d "$dir" ] && [ -f "$dir/package.json" ]; then
echo "::group::npm install $dir"
cd $dir && npm install && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Spell check
run: cspell "**/*.md" "**/*.dart" "**/*.ts" --no-progress
- name: Check formatting
run: |
dart format --set-exit-if-changed packages/
dart format --set-exit-if-changed examples/
dart format --set-exit-if-changed tools/build
- name: Analyze
run: |
for dir in packages/* examples/* tools/build; do
if [ -d "$dir" ] && [ -f "$dir/pubspec.yaml" ]; then
echo "::group::Analyzing $dir"
cd $dir && dart analyze --no-fatal-warnings && cd - > /dev/null
echo "::endgroup::"
fi
done
- name: Test Tier 1
run: ./tools/test.sh --tier 1
- name: Test Tier 2
run: ./tools/test.sh --tier 2
- name: Test Tier 3
run: ./tools/test.sh --tier 3
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: logs/
retention-days: 7