@@ -4,12 +4,12 @@ description: Installs the Swift specified by a .swift-version file
44runs :
55 using : " composite"
66 steps :
7- - name : " Cache: Swift"
8- id : cache-swift
9- uses : actions/cache@v4
10- with :
11- path : " $HOME/.local/share/swiftly"
12- key : swift-${{ hashFiles('.swift-version') }}
7+ # - name: "Cache: Swift"
8+ # id: cache-swift
9+ # uses: actions/cache@v4
10+ # with:
11+ # path: "$HOME/.local/share/swiftly"
12+ # key: swift-${{ hashFiles('.swift-version') }}
1313
1414 - name : Setup Environment
1515 shell : bash
2525 echo "PATH=$SWIFTLY_BIN_DIR:$PATH" >> $GITHUB_ENV
2626 echo "PATH=\$SWIFTLY_BIN_DIR:\$PATH" >> $HOME/.bashrc
2727
28- - if : steps.cache-swift.outputs.cache-hit != 'true'
29- name : Install `apt` Dependencies
28+ - name : " Restore: Swift"
29+ uses : actions/cache/restore@v4
30+ id : cache-swift
31+ with :
32+ path : " ~/.local/share/swiftly"
33+ key : swift-${{ hashFiles('**/.swift-version') }}
34+
35+ - name : Install `apt` Dependencies
36+ if : steps.cache-swift.outputs.cache-hit != 'true'
3037 shell : bash
3138 run : |
3239 SUDO=$(if [[ $EUID -ne 0 ]]; then echo sudo; fi)
3542 env :
3643 DEBIAN_FRONTEND : noninteractive
3744
38- - if : steps.cache-swift.outputs.cache-hit != 'true'
39- name : Install Swiftly
45+ - name : Install Swiftly
46+ if : steps.cache-swift.outputs.cache-hit != 'true'
4047 shell : bash
4148 run : |
4249 UNAME=$(uname -m)
@@ -48,11 +55,18 @@ runs:
4855 --quiet-shell-followup \
4956 --no-modify-profile
5057
51- - if : steps.cache-swift.outputs.cache-hit != 'true'
52- name : Install Swift
58+ - name : Install Swift
59+ if : steps.cache-swift.outputs.cache-hit != 'true'
5360 shell : bash
5461 run : swiftly install --post-install-file ./out.sh
5562
63+ - name : " Save: Swift"
64+ if : steps.cache-swift.outputs.cache-hit != 'true'
65+ uses : actions/cache/save@v4
66+ with :
67+ path : " ~/.local/share/swiftly"
68+ key : swift-${{ hashFiles('**/.swift-version') }}
69+
5670 - name : Print Swift Version
5771 shell : bash
5872 run : swift --version
0 commit comments