-
-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (98 loc) · 3.08 KB
/
sugar_publish.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
name: Publish Sugar Package
on:
push:
tags:
- 'sugar/[0-9]+.[0-9]+.[0-9]+*'
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: sugar
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart analyze --fatal-warnings
- run: dart run coverage:test_with_coverage
- run: sudo apt-get update -y
- run: sudo apt-get install -y lcov
- run: lcov --remove ./coverage/lcov.info '**.g.dart' -o ./coverage/lcov.info
- uses: codecov/codecov-action@v5
with:
files: ./sugar/coverage/lcov.info
test-windows:
name: Run integration tests on Windows
runs-on: windows-latest
defaults:
run:
working-directory: sugar
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart run coverage:test_with_coverage test ./integration_test/
- uses: codecov/codecov-action@v5
with:
files: ./sugar/coverage/lcov.info
test-macos:
name: Run integration tests on macOS
runs-on: macos-latest
defaults:
run:
working-directory: sugar
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: chmod +x ./integration_test/src/time/zone/platform/platform_provider_test_macos.sh
- run: ./integration_test/src/time/zone/platform/platform_provider_test_macos.sh
- uses: codecov/codecov-action@v5
with:
files: ./sugar/coverage/lcov.info
test-linux:
name: Run integration tests on linux
runs-on: ubuntu-latest
defaults:
run:
working-directory: sugar
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: chmod +x ./integration_test/src/time/zone/platform/platform_provider_test_linux.sh
- run: ./integration_test/src/time/zone/platform/platform_provider_test_linux.sh
- uses: codecov/codecov-action@v5
with:
files: ./sugar/coverage/lcov.info
test-web:
name: Run integration tests on web
runs-on: ubuntu-latest
defaults:
run:
working-directory: sugar
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- uses: browser-actions/setup-firefox@v1
with:
firefox-version: latest
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: chmod +x ./integration_test/src/time/zone/platform/platform_provider_test_browser.sh
- run: ./integration_test/src/time/zone/platform/platform_provider_test_browser.sh
- uses: codecov/codecov-action@v5
with:
files: ./sugar/coverage/lcov.info
publish:
permissions:
contents: 'read'
id-token: 'write'
needs: [test, test-windows, test-macos, test-linux, test-web]
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: pub.dev
working-directory: sugar