-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (91 loc) · 2.79 KB
/
Copy pathprotocol-contract-ci.yml
File metadata and controls
109 lines (91 loc) · 2.79 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
name: Protocol Contract CI
on:
push:
branches: [ main ]
paths:
- 'app/test/fixtures/**'
- 'server/test/fixtures/**'
- 'app/test/codec_contract_test.dart'
- 'server/test/protocol/contract.test.ts'
- 'app/lib/transport/**'
- 'server/src/protocol/**'
- '.github/workflows/protocol-contract-ci.yml'
pull_request:
branches: [ main ]
paths:
- 'app/test/fixtures/**'
- 'server/test/fixtures/**'
- 'app/test/codec_contract_test.dart'
- 'server/test/protocol/contract.test.ts'
- 'app/lib/transport/**'
- 'server/src/protocol/**'
- '.github/workflows/protocol-contract-ci.yml'
jobs:
fixture-sync:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Verify shared fixtures are byte-identical
run: |
diff -rq app/test/fixtures server/test/fixtures
echo "Shared fixtures are byte-identical between app and server."
server-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: fixture-sync
defaults:
run:
working-directory: server
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22'
- name: Enable Corepack
run: corepack enable
- name: Prepare pnpm
run: corepack prepare pnpm@11.8.0 --activate
- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('server/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm secure:install
- name: Run server protocol contract tests
run: node --import tsx --test test/protocol/contract.test.ts
flutter-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: fixture-sync
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.9'
channel: 'stable'
- name: Cache Flutter dependencies
uses: actions/cache@v5
with:
path: |
${{ runner.tool_cache }}/flutter/
~/.pub-cache/
key: ${{ runner.os }}-flutter-3.44.9-${{ hashFiles('app/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-3.44.9-
- name: Install Flutter dependencies
run: |
cd app
flutter pub get --enforce-lockfile
- name: Run Flutter protocol contract tests
run: |
cd app
flutter test test/codec_contract_test.dart