Support dynamic values for PUB-CACHE-PATH (#363)
* use expand_key for PUB_CACHE_PATH * add tests * add dash * use PUB_CACHE
This commit is contained in:
committed by
GitHub
parent
ca16aee0c3
commit
fd55f4c5af
8
.github/workflows/workflow.yaml
vendored
8
.github/workflows/workflow.yaml
vendored
@@ -207,6 +207,10 @@ jobs:
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -c '/tmp/flutter/:channel:-:version:-:hash:' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da'
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -d '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-path' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-path'
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -l '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-key' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-key'
|
||||
shell: bash
|
||||
|
||||
|
||||
test_print_output_arm64:
|
||||
@@ -276,3 +280,7 @@ jobs:
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -c '/tmp/flutter/:channel:-:version:-:hash:' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da'
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -d '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-path' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-path'
|
||||
shell: bash
|
||||
- run: ./setup.sh -t -p -l '/tmp/flutter/:channel:-:version:-:hash:-pub-cache-key' | grep '/tmp/flutter/stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da-pub-cache-key'
|
||||
shell: bash
|
||||
|
||||
@@ -320,7 +320,7 @@ steps:
|
||||
# optional parameters follow
|
||||
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
|
||||
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
|
||||
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
|
||||
pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
|
||||
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
|
||||
- run: flutter --version
|
||||
```
|
||||
|
||||
3
setup.sh
3
setup.sh
@@ -97,7 +97,7 @@ while getopts 'tc:k:d:l:pa:n:f:g:' flag; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
g) GIT_SOURCE="$OPTARG" ;;
|
||||
g) GIT_SOURCE="$OPTARG" ;;
|
||||
?) exit 2 ;;
|
||||
esac
|
||||
done
|
||||
@@ -180,6 +180,7 @@ expand_key() {
|
||||
CACHE_KEY=$(expand_key "$CACHE_KEY")
|
||||
PUB_CACHE_KEY=$(expand_key "$PUB_CACHE_KEY")
|
||||
CACHE_PATH=$(expand_key "$(transform_path "$CACHE_PATH")")
|
||||
PUB_CACHE=$(expand_key "$(transform_path "$PUB_CACHE")")
|
||||
|
||||
if [ "$PRINT_ONLY" = true ]; then
|
||||
version_info=$(echo "$VERSION_MANIFEST" | jq -j '.channel,":",.version,":",.dart_sdk_arch // "x64"')
|
||||
|
||||
Reference in New Issue
Block a user