-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 1.49 KB
/
ci.yml
File metadata and controls
65 lines (57 loc) · 1.49 KB
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
name: CI
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "lib/**.dart"
- "test/**.dart"
pull_request:
branches:
- "main"
paths:
- "lib/**.dart"
- "test/**.dart"
jobs:
checkout:
name: "Checkout"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
container:
image: dart:stable
timeout-minutes: 10
steps:
- name: 🚂 Get latest code
uses: actions/checkout@v2
- name: 🚃 Cache pub modules
uses: actions/cache@v3
env:
cache-name: cache-leetcode-pub
with:
path: |
$PWD/.pub_cache/
key: ${{ runner.os }}-leetcode
- name: 🗄️ Export pub cache directory
run: export PUB_CACHE=$PWD/.pub_cache/
- name: 👷 Install Dependencies
timeout-minutes: 1
run: dart pub get
# - name: 🔎 Check format
# timeout-minutes: 1
# run: dart format --set-exit-if-changed -l 120 -o none .
- name: 📈 Analyze code
timeout-minutes: 1
run: dart analyze --fatal-infos --fatal-warnings lib
- name: 🧪 Run tests
timeout-minutes: 2
run: |
dart run coverage:test_with_coverage -fb -o coverage -- \
--concurrency=6 --platform vm --coverage=./coverage --reporter=expanded test/leetcode_test.dart
- name: 📥 Upload coverage to Codecov
timeout-minutes: 1
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}