Install shellcheck in pre-commit env (#1410)

This commit is contained in:
Bart Louwers
2023-07-24 17:12:00 +02:00
committed by GitHub
parent 6ed0c1869e
commit 4f649450d3
12 changed files with 37 additions and 35 deletions

View File

@@ -216,7 +216,7 @@ jobs:
name: uploadsEnv
- name: Read uploads.env
run: cat uploads.env >> $GITHUB_ENV
run: cat uploads.env >> "$GITHUB_ENV"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2

View File

@@ -87,7 +87,7 @@ jobs:
run: |
RELEASE_VERSION="$( git describe --tags --match=android-v*.*.* --abbrev=0 | sed 's/^android-v//' )"
echo "Latest version from tag: $RELEASE_VERSION"
if [ ! -z "$RELEASE_VERSION" ]; then
if [ -n "$RELEASE_VERSION" ]; then
sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${RELEASE_VERSION}/" MapboxGLAndroidSDK/gradle.properties
echo "MapboxGLAndroidSDK/gradle.properties:"
cat MapboxGLAndroidSDK/gradle.properties
@@ -116,9 +116,9 @@ jobs:
id: prepare_release
run: |
RELEASE_NOTES_PATH="${PWD}/release_notes.txt"
./scripts/release-notes.js > ${RELEASE_NOTES_PATH}
echo release_notes=${RELEASE_NOTES_PATH} >> "$GITHUB_OUTPUT"
echo version_tag=$( git describe --tags --match=android-v*.*.* --abbrev=0 ) >> "$GITHUB_OUTPUT"
./scripts/release-notes.js > "${RELEASE_NOTES_PATH}"
echo release_notes="${RELEASE_NOTES_PATH}" >> "$GITHUB_OUTPUT"
echo version_tag="$( git describe --tags --match=android-v*.*.* --abbrev=0 )" >> "$GITHUB_OUTPUT"
shell: bash
- name: Create release

View File

@@ -25,14 +25,14 @@ jobs:
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 )
cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" | cut -f 1 )"
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
done
echo "Done"
env:

View File

@@ -145,7 +145,7 @@ jobs:
working-directory: ./
run: |
bazel build --compilation_mode=opt //platform/ios:size --//:maplibre_platform=ios
cp $(bazel cquery --compilation_mode=opt --output=files //platform/ios:size --//:maplibre_platform=ios) ./size
cp "$(bazel cquery --compilation_mode=opt --output=files //platform/ios:size --//:maplibre_platform=ios)" ./size
- name: Upload size test result
uses: actions/upload-artifact@v3
@@ -170,7 +170,7 @@ jobs:
mv RenderTestApp.zip RenderTestApp.ipa
cd Payload/RenderTestApp.app/PlugIns
zip -r "$render_test_app_dir"/RenderTest.xctest.zip RenderTest.xctest
echo render_test_artifacts_dir="$render_test_app_dir" >> $GITHUB_ENV
echo render_test_artifacts_dir="$render_test_app_dir" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v3
with:

View File

@@ -71,16 +71,16 @@ jobs:
max_checks=10
sleep_time=5
check_status()
echo "$(aws devicefarm get-upload --arn $1 | jq -r '.upload.status')"
end
check_status() {
aws devicefarm get-upload --arn "$1" | jq -r '.upload.status'
}
for i in {1..$max_checks}; do
status_app=$(check_status "${{ env.app_arn }}")
status_test_package=$(check_status "${{ env.test_package_arn }}")
while ((max_checks--)); do
status_app="$(check_status "${{ env.app_arn }}")"
status_test_package="$(check_status "${{ env.test_package_arn }}")"
echo status_app=$status_app
echo status_test_package=$status_test_package
echo status_app="$status_app"
echo status_test_package="$status_test_package"
if [[ "$status_app" == "SUCCEEDED" && "$status_test_package" == "SUCCEEDED" ]]; then
exit 0

View File

@@ -209,7 +209,7 @@ jobs:
- name: Generate coverage report
run: |
bazel coverage --test_output=all --combined_report=lcov --nobuild_runfile_links --local_test_jobs=1 --instrumentation_filter="//:mbgl-core" //test:core //render-test:render-test --//:maplibre_platform=linux --run_under=//platform/linux:startxwrapper
echo coverage_report=$(bazel info output_path)/_coverage/_coverage_report.dat >> $GITHUB_ENV
echo coverage_report="$(bazel info output_path)"/_coverage/_coverage_report.dat >> "$GITHUB_ENV"
- name: Upload coverage report
uses: codecov/codecov-action@v3

View File

@@ -88,9 +88,9 @@ jobs:
- name: Run macOS C++ unit tests
run: |
cmake -S . -B $BUILD_DIR
cmake --build $BUILD_DIR --target mbgl-test-runner
ctest -VV --test-dir $BUILD_DIR -R mbgl-test-runner
cmake -S . -B "$BUILD_DIR"
cmake --build "$BUILD_DIR" --target mbgl-test-runner
ctest -VV --test-dir "$BUILD_DIR" -R mbgl-test-runner
env:
BUILD_DIR: ../../../maplibre-gl-native-macostestbuild

View File

@@ -214,7 +214,7 @@ jobs:
- name: Build maplibre-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
cmake --build build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)"
- name: Build maplibre-native (Windows)
if: runner.os == 'Windows'

View File

@@ -219,7 +219,7 @@ jobs:
- name: Build maplibre-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
cmake --build build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)"
- name: Build maplibre-native (Windows)
if: runner.os == 'Windows'

View File

@@ -38,7 +38,7 @@ jobs:
- name: npm version
run: |
echo "NPM_VERSION=$(npm version ${{ github.event.inputs.version }} --preid pre --no-git-tag-version)" >> $GITHUB_ENV
echo "NPM_VERSION=$(npm version ${{ github.event.inputs.version }} --preid pre --no-git-tag-version)" >> "$GITHUB_ENV"
- name: Push version to git
run: |
@@ -212,7 +212,7 @@ jobs:
- name: Build maplibre-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
cmake --build build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)"
- name: Build maplibre-native (Windows)
if: runner.os == 'Windows'
@@ -262,7 +262,7 @@ jobs:
- name: Publish to NPM (release)
if: github.ref == 'refs/heads/main' && (github.event.inputs.version == 'patch' || github.event.inputs.version == 'minor' || github.event.inputs.version == 'major')
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
@@ -270,7 +270,7 @@ jobs:
- name: Publish to NPM (prerelease)
if: github.ref == 'refs/heads/main' && (github.event.inputs.version == 'prerelease' || github.event.inputs.version == 'prepatch' || github.event.inputs.version == 'preminor' || github.event.inputs.version == 'premajor')
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --tag next --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}

View File

@@ -41,9 +41,11 @@ jobs:
key: ios-size
- run: |
echo old_size="$(cat ./size_main)" >> "$GITHUB_ENV"
echo new_size="$(cat ./size)" >> "$GITHUB_ENV"
echo percentage_change=$(awk 'NR==FNR{a=$0;next}{printf "%+.2f%%\n", 100*($0-a)/a}' ./size ./size_main) >> "$GITHUB_ENV"
{
echo old_size="$(cat ./size_main)"
echo new_size="$(cat ./size)"
echo percentage_change="$(awk 'NR==FNR{a=$0;next}{printf "%+.2f%%\n", 100*($0-a)/a}' ./size ./size_main)"
} >> "$GITHUB_ENV"
if: github.event.workflow_run.event == 'pull_request'
- name: 'Leave comment on PR with test results'

View File

@@ -175,7 +175,7 @@ jobs:
# version is pinned due to issues with caching MSVC in 4.8
choco.exe install ccache --version=4.7.5 --no-progress
ccache.exe --version
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> "$GITHUB_ENV"
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
@@ -238,7 +238,7 @@ jobs:
QT_VERSION: ${{ matrix.qt_version }}
run: |
pushd install
tar cjvf ../maplibre-native_${QT_ARCH}_Qt${QT_VERSION}.tar.bz2 *
tar cjvf ../maplibre-native_"${QT_ARCH}"_Qt"${QT_VERSION}".tar.bz2 ./*
popd
- name: Upload artifacts
@@ -294,9 +294,9 @@ jobs:
- name: Build test app
run: |
mkdir install && cd install
tar xf ../maplibre-native_${QT_ARCH}_Qt${QT_VERSION}.tar.bz2
tar xf ../maplibre-native_"${QT_ARCH}"_Qt"${QT_VERSION}".tar.bz2
cd ..
export CMAKE_PREFIX_PATH=$PWD/install
export CMAKE_PREFIX_PATH="$PWD"/install
mkdir build && cd build
cmake ../source/platform/qt/app/
make
@@ -326,7 +326,7 @@ jobs:
TAG_PLATFORM: ${{ matrix.name }}
QT_VERSION: ${{ matrix.qt_version }}
run: |
mv maplibre-native_${TAG_PLATFORM}_Qt${QT_VERSION}.tar.bz2 QMapLibreGL_${TAG_NAME//qt-/}_Qt${QT_VERSION}_${TAG_PLATFORM}.tar.bz2
mv maplibre-native_"${TAG_PLATFORM}"_Qt"${QT_VERSION}".tar.bz2 QMapLibreGL_"${TAG_NAME//qt-/}"_Qt"${QT_VERSION}"_"${TAG_PLATFORM}".tar.bz2
- name: Release
uses: ncipollo/release-action@v1