Skip to content

Commit 6bffd64

Browse files
committed
ci: add testing
1 parent bf76219 commit 6bffd64

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

β€Ž.github/workflows/tests.yamlβ€Ž

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Unit Testing
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: πŸ“š Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: 🐦 Set up Dart
21+
uses: dart-lang/setup-dart@v1
22+
with:
23+
sdk: stable
24+
25+
- name: πŸ“¦ Install dependencies
26+
run: dart pub get
27+
28+
- name: πŸ§ͺ Run Tests
29+
run: dart test -r json > test-results.json
30+
continue-on-error: true
31+
32+
- name: πŸ“Š Upload Test Results
33+
uses: actions/upload-artifact@v4.6.2
34+
with:
35+
name: test-results
36+
path: test-results.json
37+
38+
- name: πŸ“ Check Test Results
39+
run: |
40+
if grep -q '"result":"failure"' test-results.json; then
41+
echo "❌ Tests failed"
42+
exit 1
43+
fi
44+
echo "βœ… All tests passed"

0 commit comments

Comments
Β (0)