|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | + |
| 6 | +name: Dart |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: [ "main" ] |
| 11 | + pull_request: |
| 12 | + branches: [ "main" ] |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + # Note: This workflow uses the latest stable version of the Dart SDK. |
| 22 | + # You can specify other versions if desired, see documentation here: |
| 23 | + # https://github.com/dart-lang/setup-dart/blob/main/README.md |
| 24 | + # - uses: dart-lang/setup-dart@v1 |
| 25 | + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: dart pub get |
| 29 | + |
| 30 | + # Uncomment this step to verify the use of 'dart format' on each commit. |
| 31 | + # - name: Verify formatting |
| 32 | + # run: dart format --output=none --set-exit-if-changed . |
| 33 | + |
| 34 | + # Consider passing '--fatal-infos' for slightly stricter analysis. |
| 35 | + - name: Analyze project source |
| 36 | + run: dart analyze |
| 37 | + |
| 38 | + |
| 39 | + - name: Setup Node.js environment |
| 40 | + uses: actions/setup-node@v3.9.1 |
| 41 | + with: |
| 42 | + # Set always-auth in npmrc. |
| 43 | + always-auth: # optional, default is false |
| 44 | + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. |
| 45 | + node-version: # optional |
| 46 | + # File containing the version Spec of the version to use. Examples: .nvmrc, .node-version, .tool-versions. |
| 47 | + node-version-file: # optional |
| 48 | + # Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. |
| 49 | + architecture: # optional |
| 50 | + # Set this option if you want the action to check for the latest available version that satisfies the version spec. |
| 51 | + check-latest: # optional |
| 52 | + # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. |
| 53 | + registry-url: # optional |
| 54 | + # Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). |
| 55 | + scope: # optional |
| 56 | + # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. |
| 57 | + token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} |
| 58 | + # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. |
| 59 | + cache: # optional |
| 60 | + # Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies. |
| 61 | + cache-dependency-path: # optional |
| 62 | + |
| 63 | + |
| 64 | + # Your project will need to have tests in test/ and a dependency on |
| 65 | + # package:test for this step to succeed. Note that Flutter projects will |
| 66 | + # want to change this to 'flutter test'. |
| 67 | + - name: Run tests |
| 68 | + run: dart test |
0 commit comments