-
Notifications
You must be signed in to change notification settings - Fork 38
138 lines (120 loc) · 3.94 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
name: Test Workflow
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
setup_and_initial_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout mix repo
uses: actions/checkout@v2
with:
path: main
- name: Checkout remix_ui repo
uses: actions/checkout@v2
with:
repository: conceptadev/remix_ui
path: remix
- name: Archive workspace
uses: actions/upload-artifact@v3
with:
name: workspace
path: |
main
remix
test_mix_repo:
runs-on: ubuntu-latest
needs: setup_and_initial_checks
steps:
- name: Download workspace
uses: actions/download-artifact@v3
with:
name: workspace
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: cd main && flutter pub get
- run: cd main && flutter test
update_and_analyze_remix_ui:
runs-on: ubuntu-latest
needs: test_mix_repo
steps:
- name: Download workspace
uses: actions/download-artifact@v3
with:
name: workspace
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Add most recent mix version to remix_ui
run: |
cd remix
dart pub remove mix
dart pub add 'mix:{"git":{"url":"https://github.com/conceptadev/mix","ref": ${{ github.head_ref }}}}'
- name: Verify if there are any undefined symbols
id: undefined_symbols
run: |
cd remix
if flutter analyze lib | grep -q 'undefined'; then
echo "A file contains undefined symbols. Please add a deprecated annotation before you remove it."
exit 1
fi
- name: Add Label to Issue
uses: actions/github-script@v7
if: ${{ failure() && steps.undefined_symbols.conclusion == 'failure' }}
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['New Deprecation']
})
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hello 😊, we have noticed a breaking change in our API. Please add the deprecated annotation before you remove it.'
})
test_remix_ui:
runs-on: ubuntu-latest
continue-on-error: true
needs: update_and_analyze_remix_ui
if: ${{ needs.update_and_analyze_remix_ui.result == 'success' }}
steps:
- name: Download workspace
uses: actions/download-artifact@v3
with:
name: workspace
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Add most recent mix version to remix_ui
run: |
cd remix
dart pub remove mix
dart pub add 'mix:{"git":{"url":"https://github.com/conceptadev/mix","ref":${{ github.head_ref }}}}'
- run: cd remix && flutter test
id: remix_test
- name: Add Label to Issue and Comment
uses: actions/github-script@v7
if: ${{ failure() && steps.remix_test.conclusion == 'failure' }}
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Behavior Change']
})
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'We have noticed a change in Mix's behavior. Are you sure about this?'
})