A GitHub Action to install and setup a Dart SDK.
  • Dart 92.6%
  • JavaScript 7.4%
Find a file
dependabot[bot] cb71272895
Bump the github-actions group with 2 updates (#177)
Bumps the github-actions group with 2 updates: [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) and [flutter-actions/setup-flutter](https://github.com/flutter-actions/setup-flutter).

Updates `dart-lang/setup-dart` from 1.7.1 to 1.7.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/releases">dart-lang/setup-dart's releases</a>.</em></p>
<blockquote>
<h2>v1.7.2</h2>
<ul>
<li>Update Node.js requirement to Node 24.</li>
<li>Fix open Dependabot alerts by bumping <code>undici</code> to <code>&gt;=6.24.0</code>.</li>
<li>Update GitHub Action dependencies (<code>@actions/core</code>, <code>@actions/exec</code>, <code>@actions/tool-cache</code>, <code>@actions/http-client</code>).</li>
<li>Update workflow actions to their latest versions (<code>actions/checkout</code> v6, <code>setup-flutter</code>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md">dart-lang/setup-dart's changelog</a>.</em></p>
<blockquote>
<h2>v1.7.2</h2>
<ul>
<li>Update Node.js requirement to Node 24.</li>
<li>Fix open Dependabot alerts by bumping <code>undici</code> to <code>&gt;=6.24.0</code>.</li>
<li>Update GitHub Action dependencies (<code>@actions/core</code>, <code>@actions/exec</code>, <code>@actions/tool-cache</code>, <code>@actions/http-client</code>).</li>
<li>Update workflow actions to their latest versions (<code>actions/checkout</code> v6, <code>setup-flutter</code>).</li>
</ul>
<h2>v1.7.1</h2>
<ul>
<li>Roll <code>undici</code> dependency to address <a href="https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975">CVE-2025-22150</a>.</li>
<li>Update to the latest npm dependencies.</li>
<li>Recompile the action using the new Dart / JavaScript interop.</li>
</ul>
<h2>v1.7.0</h2>
<ul>
<li>
<p>Install flutter sdk in publishing step, allowing Flutter packages to be
published (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">#68</a>[])</p>
<p><a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">#68</a>: <a href="https://redirect.github.com/dart-lang/setup-dart/issues/68">dart-lang/setup-dart#68</a></p>
</li>
</ul>
<h2>v1.6.5</h2>
<ul>
<li>Fix zip path handling on Windows 11 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">#118</a>[])</li>
</ul>
<p><a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">#118</a>: <a href="https://redirect.github.com/dart-lang/setup-dart/issues/118">dart-lang/setup-dart#118</a></p>
<h2>v1.6.4</h2>
<ul>
<li>Rebuild JS code.</li>
</ul>
<h2>v1.6.3</h2>
<ul>
<li>Roll <code>undici</code> dependency to address <a href="https://github.com/nodejs/undici/security/advisories/GHSA-m4v8-wqvr-p9f7">CVE-2024-30260</a> and <a href="https://github.com/nodejs/undici/security/advisories/GHSA-9qxr-qj54-h672">CVE-2024-30261</a>.</li>
</ul>
<h2>v1.6.2</h2>
<ul>
<li>Switch to running the workflow on <code>node20`` from </code>node16`. See also
<a href="https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/">Transitioning from Node 16 to Node 20</a>.</li>
</ul>
<h2>v1.6.1</h2>
<ul>
<li>Updated the google storage url for <code>main</code> channel releases.</li>
</ul>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="65eb853c7b"><code>65eb853</code></a> chore: prepare v1.7.2 release (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/175">#175</a>)</li>
<li><a href="6e0ff0bc3a"><code>6e0ff0b</code></a> Node 24 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/174">#174</a>)</li>
<li><a href="03a180dbe1"><code>03a180d</code></a> Group npm dependency updates (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/172">#172</a>)</li>
<li><a href="74195ec01a"><code>74195ec</code></a> Bump <code>@​actions/exec</code> from 1.1.1 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/167">#167</a>)</li>
<li><a href="41705c951d"><code>41705c9</code></a> Bump <code>@​actions/core</code> from 1.11.1 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/168">#168</a>)</li>
<li><a href="dd42013d44"><code>dd42013</code></a> Bump <code>@​actions/tool-cache</code> from 2.0.2 to 4.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/169">#169</a>)</li>
<li><a href="b36cb5e0e6"><code>b36cb5e</code></a> Bump <code>@​actions/http-client</code> from 3.0.0 to 4.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/170">#170</a>)</li>
<li><a href="21e68f4d54"><code>21e68f4</code></a> Bump actions/checkout from 5 to 6 in the github-actions group (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/162">#162</a>)</li>
<li><a href="0bdb60234e"><code>0bdb602</code></a> Bump <code>@​actions/http-client</code> from 2.2.3 to 3.0.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/160">#160</a>)</li>
<li><a href="daef289245"><code>daef289</code></a> Bump flutter-actions/setup-flutter in the github-actions group (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/159">#159</a>)</li>
<li>Additional commits viewable in <a href="e51d8e571e...65eb853c7b">compare view</a></li>
</ul>
</details>
<br />

Updates `flutter-actions/setup-flutter` from d4e97a6e7467ef062618c9af927f90bc9651b876 to 18c66a64fb6f6d3338c63cabbc5cd6da395e7f1d
<details>
<summary>Commits</summary>
<ul>
<li><a href="18c66a64fb"><code>18c66a6</code></a> Update test workflows</li>
<li><a href="480ffd9d3a"><code>480ffd9</code></a> Merge pull request <a href="https://redirect.github.com/flutter-actions/setup-flutter/issues/16">#16</a> from alexdlaird/update-cache-to-v5</li>
<li><a href="c3a6417c90"><code>c3a6417</code></a> Update actions/cache@v4 to v5 for Node 24 compatibility</li>
<li>See full diff in <a href="d4e97a6e74...18c66a64fb">compare view</a></li>
</ul>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions

</details>
2026-04-01 15:21:59 +00:00
.github Bump the github-actions group with 2 updates (#177) 2026-04-01 15:21:59 +00:00
dist chore: prepare v1.7.2 release (#175) 2026-03-23 17:02:36 +01:00
example convert the implementation of the action to Dart (#77) 2023-03-04 09:57:16 -08:00
lib updates to move away from dart:js_util (#148) 2025-02-13 08:01:55 -08:00
tool Clean up after renaming the be channel to main. (#115) 2024-01-09 11:49:25 -08:00
.gitattributes convert the implementation of the action to Dart (#77) 2023-03-04 09:57:16 -08:00
.gitignore convert the implementation of the action to Dart (#77) 2023-03-04 09:57:16 -08:00
action.yml Node 24 (#174) 2026-03-19 09:00:10 +01:00
analysis_options.yaml no longer specify the inline-class experiment flag (#125) 2024-03-11 10:55:02 -07:00
CHANGELOG.md chore: prepare v1.7.2 release (#175) 2026-03-23 17:02:36 +01:00
CONTRIBUTING.md convert the implementation of the action to Dart (#77) 2023-03-04 09:57:16 -08:00
DEVELOPING.md no longer test on pre-2.12 SDKs (#84) 2023-03-22 13:51:54 -07:00
LICENSE Small tweaks requested in internal review (#28) 2021-03-19 16:11:49 +01:00
package-lock.json chore: prepare v1.7.2 release (#175) 2026-03-23 17:02:36 +01:00
package.json Node 24 (#174) 2026-03-19 09:00:10 +01:00
pubspec.yaml updates to move away from dart:js_util (#148) 2025-02-13 08:01:55 -08:00
README.md Update CHANGELOG.md (#128) 2024-04-09 12:18:08 +02:00

setup-dart

setup-dart installs and sets up a Dart SDK for use in GitHub Actions; it:

  • downloads the Dart SDK
  • adds the dart tool to the system path

Usage

To install the latest stable Dart SDK and run typical checks:

name: Dart

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dart-lang/setup-dart@v1

      - run: dart pub get
      - run: dart format --output=none --set-exit-if-changed .
      - run: dart analyze
      - run: dart test

Inputs

The action takes the following inputs:

  • sdk: Which SDK version to setup. Can be specified using one of three forms:

    • A release channel, which will install the latest build from that channel. Available channels are stable, beta, dev, and main. See the Dart SDK archive for details.
    • An SDK release version - e.g. 2.19 or 3.1. This will install the latest patch release for that specific release version.
    • A specific SDK version, e.g. 2.19.0 or 2.12.0-1.4.beta.
  • flavor: Which build flavor to setup.

    • The available build flavors are release and raw.
    • The release flavor contains published builds.
    • The raw flavor contains unpublished builds; these can be used by developers to test against SDK versions before a signed release is available. Note that the main release channel only supports the raw build flavor.
  • architecture: The CPU architecture to setup support for.

    • Valid options are x64, ia32, arm, and arm64.
    • Note that not all CPU architectures are supported on all operating systems; see the Dart system requirements for valid combinations.

Outputs

The action produces the following output:

  • dart-version: The version of the Dart SDK that was installed.

Matrix testing example

You can create matrix jobs that run tests on multiple operating systems, and multiple versions of the Dart SDK.

The following example creates a matrix across two dimensions:

  • three major operating systems: Linux, MacOS, and Windows
  • several Dart SDK versions: a specific version, the latest stable, beta, and dev
name: Dart

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        sdk: [3.1, stable, beta]
    steps:
      - uses: actions/checkout@v4
      - uses: dart-lang/setup-dart@v1
        with:
          sdk: ${{ matrix.sdk }}

      - name: Install dependencies
        run: dart pub get

      - name: Run tests
        run: dart test

License

See the LICENSE file.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md.

Version history

Please see our CHANGELOG.md file.