Skip to content

Commit

Permalink
[github] Use sparse checkout & shallow clone everywhere
Browse files Browse the repository at this point in the history
Signed-off-by: Ferenc Géczi <[email protected]>
  • Loading branch information
Ferenc- committed May 24, 2024
1 parent 666703e commit 969f021
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/android-check-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
android/app/src/fdroid
android/app/src/google
tools/python/check_store_metadata.py
- name: Check metadata
run: ./tools/python/check_store_metadata.py android
24 changes: 19 additions & 5 deletions .github/workflows/android-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ on:
- packaging/**
- platform/*apple*
- platform/*_ios*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- platform/*_linux*
- platform/*_mac*
- platform/*qt*
- platform/*_win*
- pyhelpers/**
- qt*/**
- skin_generator/**
Expand All @@ -46,6 +46,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: "3party\nandroid\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\nindexer\n\
kml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
routing\nrouting_common\nsearch\nshaders\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
tracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down Expand Up @@ -82,7 +89,14 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 200 # enough to get all commits for the current day
fetch-depth: 1
sparse-checkout: "3party\nandroid\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\nindexer\n\
kml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
routing\nrouting_common\nsearch\nshaders\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
tracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/android-monkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1000 # fetch month or so
fetch-depth: 250 # fetch a week or so

- name: Check that Android was updated
id: check
shell: bash
run: |
DIRS="android base drape drape_frontend editor ge0 map platform routing search shaders storage traffic transit"
if [ '${{ github.event_name }}' != 'schedule' ] ||
if [ '${{ github.event_name }}' != 'schedule' ] ||
[ $(git rev-list --count --since="24 hours" HEAD $DIRS) -gt 0 ]; then
echo "updated=true" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -50,7 +50,14 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 100 # enough to get all commits for the current day
fetch-depth: 1
sparse-checkout: "3party\nandroid\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\nindexer\n\
kml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
routing\nrouting_common\nsearch\nshaders\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
tracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/android-release-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: "3party\nandroid\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngeometry\nindexer\n\
kml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
routing\nrouting_common\nsearch\nshaders\n\
std\nstorage\ntraffic\ntesting\ntopography_generator\ntrack_analyzing\n\
tracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/appstream-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
packaging/app.organicmaps.desktop.metainfo.xml
- name: Install appstream validator and flatpak Builder
shell: bash
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/cleanup_caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Cleanup
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/coverage-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 100 # enough to get all commits for the current day
fetch-depth: 1
sparse-checkout: "3party\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\n\
indexer\nkml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
qt\nqt_tstfrm\nrouting\nrouting_common\nsearch\nshaders\nskin_generator\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
track_generator\ntracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand All @@ -82,15 +89,17 @@ jobs:
sudo apt update -y
sudo apt install -y \
ninja-build \
libfreetype-dev \
libharfbuzz-dev \
libgl1-mesa-dev \
libglvnd-dev \
qt6-base-dev \
libqt6svg6-dev \
qt6-positioning-dev \
libqt6positioning6-plugins \
libqt6positioning6 \
llvm
pip install gcovr
llvm \
gcovr
- name: Configure
shell: bash
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ios-check-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
iphone/metadata
tools/python/check_store_metadata.py
- name: Check metadata
run: ./tools/python/check_store_metadata.py ios
11 changes: 10 additions & 1 deletion .github/workflows/ios-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: "3party\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\nindexer\n\
iphone\nkml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
routing\nrouting_common\nsearch\nshaders\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
tracking\ntraffic\ntransit\nxcode\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down Expand Up @@ -103,4 +112,4 @@ jobs:
-destination 'generic/platform=iOS' \
-quiet \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
CODE_SIGNING_ALLOWED=NO
20 changes: 19 additions & 1 deletion .github/workflows/linux-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 100 # enough to get all commits for the current day
fetch-depth: 1
sparse-checkout: "3party\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\n\
indexer\nkml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
qt\nqt_tstfrm\nrouting\nrouting_common\nsearch\nshaders\nskin_generator\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
track_generator\ntracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand All @@ -60,6 +67,7 @@ jobs:
ninja-build \
libgl1-mesa-dev \
libglvnd-dev \
libfreetype-dev \
libharfbuzz-dev \
qt6-base-dev \
libqt6svg6-dev \
Expand Down Expand Up @@ -114,6 +122,15 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: "3party\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\n\
indexer\nkml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
qt\nqt_tstfrm\nrouting\nrouting_common\nsearch\nshaders\nskin_generator\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
track_generator\ntracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand All @@ -127,6 +144,7 @@ jobs:
ninja-build \
libgl1-mesa-dev \
libglvnd-dev \
libfreetype-dev \
libharfbuzz-dev \
qt6-base-dev \
libqt6svg6-dev \
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/macos-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: "3party\nbase\ncmake\ncoding\ncppjansson\ndata\ndescriptions\n\
drape\ndrape_frontend\neditor\nfeature_list\nge0\ngenerator\ngeometry\n\
indexer\nkml\nmap\nopenlr\npackaging\nplatform\npoly_borders\npyhelpers\n\
qt\nqt_tstfrm\nrouting\nrouting_common\nsearch\nshaders\nskin_generator\n\
std\nstorage\ntraffic\ntesting\ntools\ntopography_generator\ntrack_analyzing\n\
track_generator\ntracking\ntraffic\ntransit\nCMakeLists.txt\nconfigure.sh\n\
defines.hpp\ngcovr.cfg\nomim_config.h\nprecompiled_headers.hpp\nprivate_default.h"

- name: Parallel submodules checkout
shell: bash
Expand Down
1 change: 1 addition & 0 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ usage() {
}

setup_opensource() {
mkdir -p "$(dirname ${PRIVATE_NETWORK_CONFIG})" # Ensure operation in case of a sparse checkout
echo "Initializing repository with default values in Open-Source mode."
cat "$DEFAULT_PRIVATE_HEADER" > "$BASE_PATH/$PRIVATE_HEADER"
echo 'ext {
Expand Down

0 comments on commit 969f021

Please sign in to comment.