8000 Modify CI workflow · nullskill/leetcode@c2d08b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit c2d08b8

Browse files
committed
Modify CI workflow
1 parent a689d1f commit c2d08b8

File tree

1 file changed

+55
-15
lines changed

1 file changed

+55
-15
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,65 @@
11
name: CI
2-
on:
2+
on:
3+
workflow_dispatch:
34
push:
45
branches:
5-
- main
6-
6+
- "main"
7+
paths:
8+
- "lib/**.dart"
9+
- "test/**.dart"
10+
pull_request:
11+
branches:
12+
- "main"
13+
paths:
14+
- "lib/**.dart"
15+
- "test/**.dart"
16+
717
jobs:
8-
dart-test:
9-
name: Run Dart test and analyze
18+
checkout:
19+
name: "Checkout"
1020
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
working-directory: ./
24+
container:
25+
image: dart:stable
26+
timeout-minutes: 10
1127
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v2
28+
- name: 🚂 Get latest code
29+
uses: actions/checkout@v2
30+
31+
- name: 🚃 Cache pub modules
32+
uses: actions/cache@v2
33+
env:
34+
cache-name: cache-leetcode-pub
35+
with:
36+
path: |
37+
$PWD/.pub_cache/
38+
key: ${{ runner.os }}-leetcode
39+
40+
- name: 🗄️ Export pub cache directory
41+
run: export PUB_CACHE=$PWD/.pub_cache/
42+
43+
- name: 👷 Install Dependencies
44+
timeout-minutes: 1
45+
run: dart pub get
1446

15-
- name: Set up Dart
16-
uses: dart-lang/setup-dart@v1
47+
- name: 🔎 Check format
48+
timeout-minutes: 1
49+
run: dart format --set-exit-if-changed -l 120 -o none .
1750

18-
- name: Install dependencies
19-
run: dart pub get
51+
- name: 📈 Check analyzer
52+
timeout-minutes: 1
53+
run: dart analyze --fatal-infos --fatal-warnings lib
2054

21-
- name: Analyze project source
22-
run: dart analyze
55+
- name: 🧪 Run tests
56+
timeout-minutes: 2
57+
run: |
58+
dart run coverage:test_with_coverage -fb -o coverage -- \
59+
--concurrency=6 --platform vm --coverage=./coverage --reporter=expanded test/leetcode_test.dart
2360
24-
- name: Run tests
25-
run: dart test
61+
- name: 📥 Upload coverage to Codecov
62+
timeout-minutes: 1
63+
uses: codecov/codecov-action@v2.1.0
64+
# with:
65+
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

0 commit comments

Comments
 (0)
0