Skip to content

Commit 8b85081

Browse files
committed
ci: cache xmake packages and bump action versions
Add actions/cache step covering xmake package and repository directories on both Linux and Windows runners. Cache key is keyed by runner OS, build mode (coverage on Linux, release on Windows) and the hashes of root and examples xmake-requires.lock so coverage and release artifacts do not pollute each other and examples deps share the same cache. Bump actions/checkout to v4 with submodules: recursive (replacing the manual submodule update step), upload-artifact to v4 and download-artifact to v4.
1 parent 5511bd1 commit 8b85081

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/ccpp.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,26 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
name: "Builds binaries on ${{ matrix.os }}"
1616
steps:
17-
- uses: actions/checkout@v1
18-
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
1921
- uses: xmake-io/github-action-setup-xmake@v1
2022
with:
2123
xmake-version: branch@dev
2224

23-
- name: Update git submodule
24-
run: |
25-
git submodule update --init
25+
- name: Cache xmake packages
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.xmake/packages
30+
~/.xmake/repositories
31+
~/AppData/Local/.xmake/packages
32+
~/AppData/Local/.xmake/repositories
33+
key: ${{ runner.os }}-xmake-${{ runner.os == 'Linux' && 'coverage' || 'release' }}-${{ hashFiles('xmake-requires.lock', 'examples/xmake-requires.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-xmake-${{ runner.os == 'Linux' && 'coverage' || 'release' }}-
36+
${{ runner.os }}-xmake-
2637
2738
- name: Install tools
2839
if: runner.os == 'Linux'
@@ -80,13 +91,13 @@ jobs:
8091
mv ../dist/lcui-examples/bin/* ../dist/lcui-examples/
8192
rm -r ../dist/lcui-examples/bin
8293
83-
- uses: actions/upload-artifact@master
94+
- uses: actions/upload-artifact@v4
8495
with:
8596
name: lcui${{ env.TARGET_MAJOR }}-${{ env.TARGET_VERSION }}-${{ env.TARGET_KIND }} (${{ runner.os }})
8697
path: |
8798
dist/lcui-package
8899
89-
- uses: actions/upload-artifact@master
100+
- uses: actions/upload-artifact@v4
90101
with:
91102
name: lcui${{ env.TARGET_MAJOR }}-examples (${{ runner.os }})
92103
path: |
@@ -100,10 +111,10 @@ jobs:
100111
ARTIFACT_DIR: ./release
101112

102113
steps:
103-
- uses: actions/checkout@v1
114+
- uses: actions/checkout@v4
104115

105116
- name: Download artifacts
106-
uses: actions/download-artifact@v3
117+
uses: actions/download-artifact@v4
107118
with:
108119
path: ${{ env.ARTIFACT_DIR }}
109120

0 commit comments

Comments
 (0)