Skip to content

Commit e7fb17b

Browse files
committed
Added CI
1 parent 5ba680e commit e7fb17b

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.github/workflows/dart.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "Dart"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'release/**'
9+
paths:
10+
- '**.dart'
11+
- './*.yaml'
12+
- .github/workflows/dart.yaml
13+
- .github/actions/flutter-setup/**
14+
releases:
15+
types: [published]
16+
branches:
17+
- 'release/**'
18+
19+
20+
jobs:
21+
install:
22+
name: "install"
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v5
26+
- uses: dart-lang/setup-dart@v1
27+
with:
28+
sdk: stable
29+
30+
format:
31+
name: "format"
32+
runs-on: ubuntu-latest
33+
needs: install
34+
35+
steps:
36+
- uses: actions/checkout@v5
37+
- uses: dart-lang/setup-dart@v1
38+
with:
39+
sdk: stable
40+
41+
- name: "dart format"
42+
run: |
43+
echo "Checking Dart formatting...\nFiles displayed below:"
44+
dart format -o none --set-exit-if-changed ./**/*.dart
45+
echo "No formatting issues found."
46+
47+
analyze:
48+
name: "analyze"
49+
runs-on: ubuntu-latest
50+
needs: install
51+
52+
steps:
53+
- uses: actions/checkout@v5
54+
- uses: dart-lang/setup-dart@v1
55+
with:
56+
sdk: stable
57+
58+
- name: "Get dependencies"
59+
run: dart pub get
60+
61+
- name: Run analysis
62+
run: dart analyze --fatal-warnings
63+
64+
test:
65+
name: "test"
66+
runs-on: ubuntu-latest
67+
needs: install
68+
69+
steps:
70+
- uses: actions/checkout@v5
71+
- uses: dart-lang/setup-dart@v1
72+
with:
73+
sdk: stable
74+
75+
- name: "Get dependencies"
76+
run: dart pub get
77+
78+
- name: Run tests
79+
run: dart test --reporter=expanded
80+
81+
publish:
82+
name: "publish"
83+
runs-on: ubuntu-latest
84+
needs: [format, analyze, test]
85+
if: github.event_name == 'release' && github.event.action == 'published'
86+
steps:
87+
- uses: actions/checkout@v5
88+
- uses: dart-lang/setup-dart@v1
89+
with:
90+
sdk: stable
91+
92+
- name: "Get dependencies"
93+
run: dart pub get
94+
95+
- name: Publish to pub.dev
96+
env:
97+
PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }}
98+
run: dart pub publish --force

.pubignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/

0 commit comments

Comments
 (0)