actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.39k stars 1.17k forks source link

Add dart example #1191

Open Yakiyo opened 1 year ago

Yakiyo commented 1 year ago

Description

I've added an example for using the action within a dart repository

Motivation and Context

Faster workflows in any dart project.

How Has This Been Tested?

I've tested the same code snippet in the example in one of my projects and it ran as intended.

Screenshots (if appropriate):

Types of changes

Checklist:

nhan19977 commented 1 year ago

![Uploading 1684654587068.jpg…]()

nhan19977 commented 1 year ago

Nhan

nhan19977 commented 1 year ago

Nhab

nhan19977 commented 1 year ago

Trường Võ Văn Kiệt

adil192 commented 12 months ago

If you use subosito/flutter-action@v2, the pub cache is in a different location:

# linux
FLUTTER_ROOT: /opt/hostedtoolcache/flutter/stable-3.10.6-x64
PUB_CACHE: /opt/hostedtoolcache/flutter/stable-3.10.6-x64/.pub-cache

# macos
FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter/stable-3.10.6-x64
PUB_CACHE: /Users/runner/hostedtoolcache/flutter/stable-3.10.6-x64/.pub-cache

# windows
FLUTTER_ROOT: C:\hostedtoolcache\windows\flutter\stable-3.10.6-x64
PUB_CACHE: C:\hostedtoolcache\windows\flutter\stable-3.10.6-x64/.pub-cache
Yakiyo commented 12 months ago

If you use subosito/flutter-action@v2, the pub cache is in a different location:

# linux
FLUTTER_ROOT: /opt/hostedtoolcache/flutter/stable-3.10.6-x64
PUB_CACHE: /opt/hostedtoolcache/flutter/stable-3.10.6-x64/.pub-cache

# macos
FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter/stable-3.10.6-x64
PUB_CACHE: /Users/runner/hostedtoolcache/flutter/stable-3.10.6-x64/.pub-cache

# windows
FLUTTER_ROOT: C:\hostedtoolcache\windows\flutter\stable-3.10.6-x64
PUB_CACHE: C:\hostedtoolcache\windows\flutter\stable-3.10.6-x64/.pub-cache

Wouldnt that be because flutter packages its own version of the dart sdk wouldnt it. That would definitely differ from just using dart. Not sure wether that needs to be specified or not.

adil192 commented 12 months ago

Wouldnt that be because flutter packages its own version of the dart sdk wouldnt it.

It's just an environment variable set by flutter-action (see the code snippet).

Not sure wether that needs to be specified or not.

Since flutter and subosito/flutter-action are quite popular, maybe a separate Flutter section should be added alongside the Dart section? I feel like just having the dart section would cause some confusion

Yakiyo commented 12 months ago

Since flutter and subosito/flutter-action are quite popular, maybe a separate Flutter section should be added alongside the Dart section? I feel like just having the dart section would cause some confusion

yes, i also feel like there should be separate section for flutter but idk if this is allowed. if one of the maintainers replied maybe something could be done.