X Tutup
Skip to content

Commit f2d7a0c

Browse files
committed
Add more caching to the mono installation
1 parent 49cea26 commit f2d7a0c

File tree

1 file changed

+44
-14
lines changed

1 file changed

+44
-14
lines changed

.github/actions/install-mono/action.yml

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,41 @@ inputs:
1010
runs:
1111
using: "composite"
1212
steps:
13-
- name: Install on macOS (x86_64)
14-
if: runner.os == 'macOS' && inputs.arch == 'x64'
15-
run: |
16-
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
17-
arch -x86_64 /usr/local/bin/brew install mono
18-
shell: sh
13+
- name: Cache on Linux
14+
if: runner.os == 'Linux'
15+
uses: actions/cache@v5
16+
with:
17+
path: .apt
18+
key: mono-${{ runner.os }}-${{ inputs.arch }}
1919

20-
- name: Install on macOS
21-
if: runner.os == 'macOS' && inputs.arch != 'x64'
22-
run: |
23-
brew update
24-
brew install mono
25-
shell: sh
20+
- name: Cache on Windows
21+
if: runner.os == 'Windows'
22+
uses: actions/cache@v5
23+
with:
24+
path: ${{ env.TEMP }}\chocolatey
25+
key: mono-${{ runner.os }}-${{ inputs.arch }}
26+
27+
# - name: Cache on macOS (x86_64)
28+
# if: runner.os == 'Linux'
29+
# uses: actions/cache@v5
30+
# with:
31+
# path: .apt
32+
# key: mono-${{ runner.os }}-${{ inputs.arch }}
33+
#
34+
# - name: Cache on macOS (arm64)
35+
# if: runner.os == 'Linux'
36+
# uses: actions/cache@v5
37+
# with:
38+
# path: .apt
39+
# key: mono-${{ runner.os }}-${{ inputs.arch }}
40+
41+
# ===================================
2642

2743
- name: Install on Linux
2844
if: runner.os == 'Linux'
2945
run: |
30-
sudo apt update
31-
sudo apt install -y mono-runtime-sgen
46+
sudo apt-get -o Dir::Cache=".apt" update
47+
sudo apt-get -o Dir::Cache=".apt" install -y mono-runtime-sgen
3248
shell: sh
3349

3450
- name: Install on Windows (x86)
@@ -41,3 +57,17 @@ runs:
4157
run: choco install -y mono
4258
shell: sh
4359

60+
- name: Install on macOS (x86_64)
61+
if: runner.os == 'macOS' && inputs.arch == 'x64'
62+
run: |
63+
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
64+
arch -x86_64 /usr/local/bin/brew install mono
65+
shell: sh
66+
67+
- name: Install on macOS (arm64)
68+
if: runner.os == 'macOS' && inputs.arch != 'x64'
69+
run: |
70+
brew update
71+
brew install mono
72+
shell: sh
73+

0 commit comments

Comments
 (0)
X Tutup