11# setup-dart
22
3- [ ![ Dart] ( https://github.com/dart-lang/setup-dart/workflows/Dart/badge.svg )] ( https://github.com/dart-lang/setup-dart/actions?query=workflow%3A%22Dart%22+branch%3Amain )
3+ [ setup-dart] ( https://github.com/dart-lang/setup-dart ) installs and sets up a
4+ Dart SDK for use in GitHub Actions; it:
45
5- This [ GitHub Action] ( https://github.com/dart-lang/setup-dart ) installs
6- and sets up of a Dart SDK for use in actions by:
7-
8- * Downloading the Dart SDK
9- * Adding the [ ` dart ` ] ( https://dart.dev/tools/dart-tool ) command
10- and [ ` pub ` cache] ( https://dart.dev/tools/pub/cmd/pub-get#the-system-package-cache )
11- to the system path
6+ * downloads the Dart SDK
7+ * adds the [ ` dart ` ] ( https://dart.dev/tools/dart-tool ) tool to the system path
128
139## Usage
1410
15- Install the latest stable SDK and run 'Hello World' :
11+ To install the latest stable Dart SDK and run typical checks :
1612
1713``` yml
18- steps :
19- - uses : actions/checkout@v3
20- - uses : dart-lang/setup-dart@v1
21- - run : dart pub get
22- - run : dart run bin/hello_world.dart
14+ name : Dart
15+
16+ on :
17+ pull_request :
18+ branches : [main]
19+ push :
20+ branches : [main]
21+
22+ jobs :
23+ build :
24+ runs-on : ubuntu-latest
25+ steps :
26+ - uses : actions/checkout@v3
27+ - uses : dart-lang/setup-dart@v1
28+
29+ - run : dart pub get
30+ - run : dart format --output=none --set-exit-if-changed .
31+ - run : dart analyze
32+ - run : dart test
2333` ` `
2434
2535## Inputs
@@ -36,8 +46,9 @@ The action takes the following inputs:
3646 * The available build flavors are `release` and `raw`.
3747 * The `release` flavor contains published builds.
3848 * The `raw` flavor contains unpublished builds; these can be used by
39- developers to test against SDK versions before a release. Note that the
40- ` main` release channel only supports `raw` build flavor.
49+ developers to test against SDK versions before a signed release is
50+ available. Note that the `main` release channel only supports the `raw`
51+ build flavor.
4152
4253 * `architecture`: The CPU architecture to setup support for.
4354 * Valid options are `x64`, `ia32`, `arm`, and `arm64`.
@@ -46,30 +57,11 @@ The action takes the following inputs:
4657 [Dart system requirements](https://dart.dev/get-dart#system-requirements)
4758 for valid combinations.
4859
49- # # Check static analysis, formatting, and run tests
60+ # # Outputs
5061
51- Various static checks :
62+ The action produces the following output :
5263
53- 1) Check static analysis with the Dart analyzer
54- 2) Check code follows Dart idiomatic formatting
55- 3) Check that unit tests pass
56-
57- ` ` ` yml
58- ...
59- steps:
60-
61- - name: Install dependencies
62- run: dart pub get
63-
64- - name: Verify formatting
65- run: dart format --output=none --set-exit-if-changed .
66-
67- - name: Analyze project source
68- run: dart analyze
69-
70- - name: Run tests
71- run: dart test
72- ` ` `
64+ * `dart-version`: The version of the Dart SDK that was installed.
7365
7466# # Matrix testing example
7567
@@ -171,4 +163,4 @@ Contributions are welcome! Please see [CONTRIBUTING.md.md](CONTRIBUTING.md.md).
171163
172164# # Version history
173165
174- Please see out [CHANGELOG.md](CHANGELOG.md) file.
166+ Please see our [CHANGELOG.md](CHANGELOG.md) file.
0 commit comments