-
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (130 loc) · 3.69 KB
/
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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Dart CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
DART_VERSION: 3.5.0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format_lint:
name: Check lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ env.DART_VERSION }}
- name: Activate Melos
run: dart pub global activate melos
- name: Verify code formatting
run: melos format --set-exit-if-changed
- name: Install coverage tools
run: dart pub global activate coverage
- name: Install Dependencies
run: melos bs
- name: Analyze
run: melos analyze -c 5
test:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [stable, beta, dev]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Activate Melos
run: dart pub global activate melos
- name: Install Dependencies
run: melos bs
working-directory: packages/athena_sql
- name: Run tests
run: dart test
working-directory: packages/athena_sql
test_postgres:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [stable, beta, dev]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
# pre-pull the image so `usePostgresDocker` does not delay which may causes
# tests to timeout
- name: pull latest postgres image
run: docker pull postgres:latest
- name: Activate Melos
run: dart pub global activate melos
- name: Install Dependencies
run: melos bs
working-directory: packages/athena_postgres
- name: Run tests
run: dart test -j 1
working-directory: packages/athena_postgres
test_mysql:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [stable, beta, dev]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Activate Melos
run: dart pub global activate melos
- name: Install Dependencies
run: melos bs
working-directory: packages/athena_mysql
- name: Run tests
run: dart test -j 1
working-directory: packages/athena_mysql
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ env.DART_VERSION }}
- name: Activate Melos
run: dart pub global activate melos
- name: Install coverage tools
run: dart pub global activate coverage
- name: Install Dependencies
run: melos bs
- name: pull latest postgres image
run: docker pull postgres:latest
- name: Test Coverage
run: melos run test:coverage
- name: "Upload Coverage"
uses: codecov/codecov-action@v3
with:
files: packages/*/coverage/lcov.info
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3