Skip to content

Commit d4eb015

Browse files
authored
Separate format check and analyzer code into new actions (exercism#604)
* GitHub Actions: Split Format Check into separate action * GitHub Actions: Split Analyze Code into separate action
1 parent 8f87d91 commit d4eb015

File tree

3 files changed

+73
-8
lines changed

3 files changed

+73
-8
lines changed

.github/workflows/analyze-code.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Analyze Code
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/test.yml'
7+
- 'bin/*.dart'
8+
- 'exercises/**/*.dart'
9+
- 'exercises/**/analysis_options.yaml'
10+
- 'exercises/**/pubspec.yaml'
11+
- 'lib/*.dart'
12+
- 'lib/src/*.dart'
13+
- 'test/*.dart'
14+
- 'analysis_options.yaml'
15+
- 'pubspec.*'
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
tag: ['3.2']
24+
25+
container:
26+
image: dart:${{ matrix.tag }}
27+
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
30+
31+
- name: Install dependencies
32+
run: dart pub get
33+
34+
# We can't check the exercises because they will produce errors since the example files have the solution.
35+
- name: Analyze Dart code
36+
run: dart analyze bin/ lib/ test/

.github/workflows/format-check.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check Formatting
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/test.yml'
7+
- 'bin/*.dart'
8+
- 'exercises/**/*.dart'
9+
- 'exercises/**/analysis_options.yaml'
10+
- 'exercises/**/pubspec.yaml'
11+
- 'lib/*.dart'
12+
- 'lib/src/*.dart'
13+
- 'test/*.dart'
14+
- 'analysis_options.yaml'
15+
- 'pubspec.*'
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
tag: ['3.2']
24+
25+
container:
26+
image: dart:${{ matrix.tag }}
27+
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
30+
31+
- name: Install dependencies
32+
run: dart pub get
33+
34+
- name: Check Stage formatting
35+
run: dart run bin/check_formatting.dart
36+

.github/workflows/test.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Run Tests
22

33
on:
44
pull_request:
@@ -31,12 +31,5 @@ jobs:
3131
- name: Install dependencies
3232
run: dart pub get
3333

34-
- name: Check Stage formatting
35-
run: dart run bin/check_formatting.dart
36-
37-
# We can't check the exercises because they will produce errors since the example files have the solution.
38-
- name: Analyze Dart code
39-
run: dart analyze bin/ lib/ test/
40-
4134
- name: Run tests
4235
run: dart test

0 commit comments

Comments
 (0)