-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (141 loc) · 9.28 KB
/
osgeo4w.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: OSGeo4W Windows Build
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release-**
- queued_ltr_backports
paths:
- 'src/**'
- 'external/**'
- 'python/**'
- 'tests/**'
- 'ms-windows/**'
- 'CMakeLists.txt'
- '.github/workflows/osgeo4w.yml'
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
REPO: ${{ github.server_url }}/${{ github.repository }}
CTEST_CUSTOM_TESTS_IGNORE: 'ProcessingQgisAlgorithmsTestPt1;ProcessingQgisAlgorithmsTestPt2;ProcessingQgisAlgorithmsTestPt3;ProcessingQgisAlgorithmsTestPt4;ProcessingQgisAlgorithmsTestPt5;ProcessingGdalAlgorithmsRasterTest;ProcessingGdalAlgorithmsVectorTest;ProcessingScriptUtilsTest;ProcessingGrassAlgorithmsImageryTest;ProcessingGrassAlgorithmsRasterTestPt1;ProcessingGrassAlgorithmsRasterTestPt2;ProcessingGrassAlgorithmsVectorTest;test_core_browsermodel;test_core_callout;test_core_compositionconverter;test_core_diagram;test_core_dxfexport;test_core_expression;test_core_fontmarker;test_core_gdalprovider;test_core_imagecache;test_core_labelingengine;test_core_layoutlabel;test_core_layoutmanualtable;test_core_layoutmap;test_core_layoutmapgrid;test_core_layoutpicture;test_core_layoutscalebar;test_core_layouttable;test_core_legendrenderer;test_core_linefillsymbol;test_core_maprendererjob;test_core_maprotation;test_core_mapsettingsutils;test_core_mesheditor;test_core_meshlayer;test_core_pallabeling;test_core_project;test_core_svgcache;test_core_svgmarker;test_core_tiledownloadmanager;test_core_vectorfilewriter;test_core_vectortilelayer;test_core_layouthtml;test_core_openclutils;test_gui_attributeform;test_gui_processinggui;test_gui_filedownloader;test_gui_ogrprovidergui;test_gui_externalresourcewidgetwrapper;test_gui_queryresultwidget;test_gui_rasterlayersaveasdialog;test_3d_3dcameracontroller;test_3d_3drendering;test_3d_layout3dmap;test_3d_mesh3drendering;test_3d_pointcloud3drendering;test_analysis_processingalgspt1;test_analysis_processingalgspt2;test_analysis_processingmodelalgorithm;test_analysis_processing;test_provider_wcsprovider;test_provider_wmsprovider;test_provider_copcprovider;qgis_grassprovidertest8;test_app_qgisappclipboard;test_app_measurebearingtool;test_app_vertextool;PyQgsAnnotationLineTextItem;PyQgsAnnotationPointTextItem;PyQgsBlockingProcess;PyQgsCesium3dTilesLayer;PyQgsColorRampLegendNode;PyQgsDelimitedTextProvider;PyQgsExifTools;PyQgsExternalStorageWebDAV;PyQgsExternalStorageAWSS3;PyQgsFontManager;PyQgsProject;PyQgsFileUtils;PyQgsGeometryGeneratorSymbolLayer;PyQgsGeometryTest;PyQgsGoogleMapsGeocoder;PyQgsGpxProvider;PyQgsLayoutAtlas;PyQgsLayoutElevationProfile;PyQgsLayoutLegend;PyQgsLayoutMap;PyQgsLayoutMapGrid;PyQgsLineSymbolLayers;PyQgsMapLayer;PyQgsOGRProviderGpkg;PyQgsOrientedBox3D;PyQgsPalLabelingCanvas;PyQgsPalLabelingLayout;PyQgsPalLabelingPlacement;PyQgsPlot;PyQgsPointCloudAttributeByRampRenderer;PyQgsPointCloudClassifiedRenderer;PyQgsPointCloudRgbRenderer;PyQgsPointDisplacementRenderer;PyQgsProcessExecutablePt2;PyQgsProcessingPackageLayersAlgorithm;PyQgsProfileExporter;PyQgsProviderConnectionSpatialite;TestQgsRandomMarkerSymbolLayer;PyQgsRasterAttributeTable;PyQgsRasterFileWriter;PyQgsRasterLayer;PyQgsRasterResampler;PyQgsSvgCache;PyQgsTextRenderer;PyQgsSensorThingsProvider;PyQgsExternalStorageSimpleCopy;PyQgsSpatialiteProvider;PyQgsTiledSceneRender;PyQgsVectorFileWriter;PyQgsVectorLayerCache;PyQgsVectorLayerEditBuffer;PyQgsVectorLayerProfileGenerator;PyQgsVirtualLayerProvider;PyQgsSettings;PyQgsSettingsEntry;PyQgsSettingsTreeNode;PyQgsZipUtils;PyQgsAuthManagerProxy;PyQgsAuxiliaryStorage;PyQgsSelectiveMasking;PyQgsAuthSettingsWidget;PyQgsOGRProvider;PyQgsWFSProviderGUI;PyQgsAnnotation;PyQgsAuthenticationSystem;PyQgsProjectionSelectionWidgets;PyQgsRasterLayerProperties;PyQgsVectorLayer;PyQgsServer;PyQgsServerWMS;PyQgsServerApi;PyQgsServerWMSGetFeatureInfo;PyQgsServerWMSGetMap;PyQgsServerWMSGetMapDxf;PyQgsServerWMSGetLegendGraphic;PyQgsServerWMSGetPrint;PyQgsServerWMSGetPrintExtra;PyQgsServerWMSGetPrintOutputs;PyQgsServerWMSGetPrintAtlas;PyQgsServerWMSGetPrintMapTheme;PyQgsServerWMSDimension;PyQgsServerSettings;PyQgsServerSecurity;PyQgsServerCacheManager;PyQgsServerWMTS;PyQgsServerWFS;PyQgsServerLocaleOverride;PyQgsOfflineEditingWFS;PyQgsAuthManagerPasswordOWSTest;PyQgsAuthManagerPKIOWSTest;PyQgsAuthManagerOAuth2OWSTest;PyQgsServerRequest'
jobs:
osgeo4w-packages:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.osgeo4w-packages.outputs.matrix }}
steps:
- name: Determine package names
id: osgeo4w-packages
run: |
RELBRANCH=$(git ls-remote --heads $REPO "refs/heads/release-*_*" | sed -e '/\^{}$/d' -ne 's#^.*refs/heads/release-#release-#p' | sort -V | tail -1)
LTRBRANCH=$(git ls-remote --tags $REPO | sed -e '/\^{}$/d' -ne 's#^.*refs/tags/ltr-#release-#p' | sort -V | fgrep -vx $RELBRANCH | tail -1)
if [ -n "$GITHUB_BASE_REF" ]; then
branch=$GITHUB_BASE_REF
else
branch=${GITHUB_REF##*/}
fi
case "$branch" in
$LTRBRANCH|queued_ltr_backports)
p=qgis-ltr-dev
;;
$RELBRANCH)
p=qgis-rel-dev
;;
master)
p="qgis-dev qgis-qt6-dev"
;;
*)
echo "Could not determine package name"
exit 1
;;
esac
echo "matrix={\"pkg\":[\"${p// /\",\"}\"]}">>$GITHUB_OUTPUT
osgeo4w-build:
name: OSGeo4W Windows Build
needs: osgeo4w-packages
runs-on: windows-latest
env:
O4W_REPO: jef-n/OSGeo4W
strategy:
matrix: ${{ fromJson(needs.osgeo4w-packages.outputs.matrix) }}
permissions:
pull-requests: write
steps:
- name: Restore build cache
uses: actions/cache/restore@v4
with:
path: ccache
key: build-ccache-osgeo4w-${{ matrix.pkg }}-${{ github.event.pull_request.base.ref || github.ref_name }}
restore-keys: |
build-ccache-osgeo4w-${{ matrix.pkg }}
- name: Build QGIS
shell: cmd
env:
PKG: ${{ matrix.pkg }}
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
REF: ${{ github.ref }}
PKGDESC: "QGIS build of ${{ github.ref }}"
OSGEO4W_BUILD_RDEPS: 0
PATH: C:\WINDOWS\system32;C:\Windows
CCACHE_DIR: ${{ github.workspace }}/ccache
SITE: github.com
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/%O4W_REPO%/master/bootstrap.cmd>bootstrap.cmd
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/%O4W_REPO%/master/bootstrap.sh>bootstrap.sh
set O4W_GIT_REPO=%GITHUB_SERVER_URL%/%O4W_REPO%
call bootstrap.cmd %PKG%
%GITHUB_WORKSPACE%\scripts\ccache -sv
- id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.pkg }}
path: x86_64/
retention-days: 1
- name: Save build cache for push only
uses: actions/cache/save@v4
if: github.event_name == 'push'
with:
path: ccache
key: build-ccache-osgeo4w-${{ matrix.pkg }}-${{ github.ref_name }}-${{ github.run_id }}
- run: npm install xml-js
if: github.event_name == 'pull_request'
- name: 'Post artifact download link and test results as comment on PR'
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
script: |
let fs = require('fs');
let tag = String(fs.readFileSync("src/${{ matrix.pkg }}/osgeo4w/build/Testing/TAG")).split("\r\n")[0]
let buildId = require('xml-js').xml2js(fs.readFileSync("src/${{ matrix.pkg }}/osgeo4w/build/Testing/" + tag + "/Done.xml"), {compact:true, ignoreDeclaration:true})['Done']['buildId']['_text']
const prComments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const PREFIX = "## OSGeo4W package ${{ matrix.pkg }} ready!";
let body = PREFIX + "\n\n" + "Package repository archive of this PR is available for testing [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload.outputs.artifact-id }}).";
body += "\n\n*(Built from commit ${{ github.event.pull_request.head.sha }})*\n";
body += "\n\n*(Test results are [here](https://cdash.orfeo-toolbox.org/viewTest.php?buildid=" + buildId + "))*";
const winBuildComment = prComments.data?.find(c => c.body.startsWith(PREFIX));
if (!!winBuildComment) {
// update the existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: winBuildComment.id,
body: body
});
} else {
// submit a new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}