@@ -4,12 +4,12 @@ description: Installs the Swift specified by a .swift-version file
4
4
runs :
5
5
using : " composite"
6
6
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') }}
13
13
14
14
- name : Setup Environment
15
15
shell : bash
25
25
echo "PATH=$SWIFTLY_BIN_DIR:$PATH" >> $GITHUB_ENV
26
26
echo "PATH=\$SWIFTLY_BIN_DIR:\$PATH" >> $HOME/.bashrc
27
27
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'
30
37
shell : bash
31
38
run : |
32
39
SUDO=$(if [[ $EUID -ne 0 ]]; then echo sudo; fi)
35
42
env :
36
43
DEBIAN_FRONTEND : noninteractive
37
44
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'
40
47
shell : bash
41
48
run : |
42
49
UNAME=$(uname -m)
@@ -48,11 +55,18 @@ runs:
48
55
--quiet-shell-followup \
49
56
--no-modify-profile
50
57
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'
53
60
shell : bash
54
61
run : swiftly install --post-install-file ./out.sh
55
62
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
+
56
70
- name : Print Swift Version
57
71
shell : bash
58
72
run : swift --version
0 commit comments