@@ -10,18 +10,48 @@ jobs:
1010 runs-on : windows-2022
1111 env :
1212 CRAFT_TARGET : windows-msvc2022_64-cl
13- COBERTURA_COVERAGE_FILE : ${{ github.workspace }}\cobertura_coverage\coverage.xml
1413 CRAFT_MASTER_LOCATION : ${{ github.workspace }}\CraftMaster
1514 CRAFT_MASTER_CONFIG : ${{ github.workspace }}\craftmaster.ini
15+ PYTHON_VERSION : ' 3.12'
1616 steps :
1717 - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1818 with :
19- fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
19+ fetch-depth : 1
2020
2121 - uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2222 with :
23- python-version : ' 3.12'
23+ python-version : ${{ env.PYTHON_VERSION }}
24+
25+ - name : Resolve Craft dependency revisions
26+ id : craft-revisions
27+ shell : pwsh
28+ run : |
29+ function remoteRevision($repository, $ref) {
30+ $revision = git ls-remote $repository $ref
31+ if($LASTEXITCODE -ne 0 -or !$revision) {
32+ throw "Could not resolve $ref from $repository."
33+ }
34+ return ($revision -split '\s+')[0]
35+ }
36+
37+ $craftMasterRevision = remoteRevision "https://invent.kde.org/packaging/craftmaster.git" "HEAD"
38+ $kdeBlueprintRevision = remoteRevision "https://github.com/nextcloud/craft-blueprints-kde.git" "refs/heads/stable-34.0"
39+ $nextcloudBlueprintRevision = remoteRevision "https://github.com/nextcloud/craft-blueprints-nextcloud.git" "refs/heads/stable-34.0"
40+ "key=$craftMasterRevision-$kdeBlueprintRevision-$nextcloudBlueprintRevision" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
41+
42+ - name : Restore Craft dependencies
43+ id : craft-cache
44+ uses : actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
45+ with :
46+ path : |
47+ ${{ env.CRAFT_MASTER_LOCATION }}
48+ ${{ env.CRAFT_MASTER_CONFIG }}
49+ ${{ github.workspace }}\craft-clone
50+ ${{ github.workspace }}\${{ env.CRAFT_TARGET }}
51+ key : ${{ runner.os }}-craft-v1-${{ env.CRAFT_TARGET }}-python-${{ env.PYTHON_VERSION }}-${{ steps.craft-revisions.outputs.key }}
52+
2453 - name : Install Craft Master with Nextcloud Client Deps
54+ if : steps.craft-cache.outputs.cache-hit != 'true'
2555 shell : pwsh
2656 run : |
2757 & cmd /C "git clone -q --depth=1 https://invent.kde.org/packaging/craftmaster.git ${{ env.CRAFT_MASTER_LOCATION }} 2>&1"
@@ -40,14 +70,12 @@ jobs:
4070 id : cache-install-opencppcoverage
4171 uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4272 with :
43- path : C:\Program Files\OpenCppCoverage
44- key : ${{ runner.os }}-cache-install-opencppcoverage
45-
46- - name : Install OpenCppCoverage
47- if : steps.cache-install-opencppcoverage.outputs.cache-hit != 'true'
48- shell : pwsh
49- run : |
50- choco install opencppcoverage
73+ path : |
74+ ${{ env.CRAFT_MASTER_LOCATION }}
75+ ${{ env.CRAFT_MASTER_CONFIG }}
76+ ${{ github.workspace }}\craft-clone
77+ ${{ github.workspace }}\${{ env.CRAFT_TARGET }}
78+ key : ${{ runner.os }}-craft-v1-${{ env.CRAFT_TARGET }}-python-${{ env.PYTHON_VERSION }}-${{ steps.craft-revisions.outputs.key }}
5179
5280 # - name: Cache Install inkscape
5381 # id: cache-install-inkscape
6593 - name : Setup PATH
6694 shell : pwsh
6795 run : |
68- echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
6996 echo "${{ github.workspace }}\${{ env.CRAFT_TARGET }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7097
7198 - name : Compile
78105
79106 craft --src-dir ${{ github.workspace }} nextcloud-client
80107
81- - name : Run tests with coverage
108+ - name : Run tests
82109 shell : pwsh
83110 run : |
84111 function runTests() {
0 commit comments