diff --git a/.github/workflows/android-beta.yaml b/.github/workflows/android-beta.yaml index 6025d0c415..9586cf580d 100644 --- a/.github/workflows/android-beta.yaml +++ b/.github/workflows/android-beta.yaml @@ -1,14 +1,37 @@ -name: Beta +name: Android Beta on: push: branches: - master + paths-ignore: + - .github/workflows/linux* + - .github/workflows/ios* + - '**/*_tests/**' + - CONTRIBUTORS + - LICENSE + - NOTICE + - README.md + - docs/** + - generator/** + - iphone/** + - packaging/** + - pyhelpers/** + - qt*/** + - skin_generator/** + - track_generator/** + - xcode/** jobs: android-beta: name: Android Beta runs-on: ubuntu-latest steps: + - name: Install build tools and dependencies + shell: bash + run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build + - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -19,8 +42,7 @@ jobs: - name: Parallel submodules checkout shell: bash - run: | - git submodule update --init --recursive --jobs=10 + run: git submodule update --init --recursive --jobs=$(($(nproc) * 2)) - name: Checkout private keys uses: actions/checkout@v2 @@ -37,22 +59,16 @@ jobs: ./configure.sh ./private.git rm -rf ./private.git - - name: Remove old outputs - shell: bash - run: | - rm -rf android/build/outputs/ - - name: Set up SDK shell: bash - run: | - (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT) + run: (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT) - name: Compile shell: bash working-directory: android run: | - export PATH="$(dirname $ANDROID_SDK_ROOT/cmake/*/bin/.|tail -n1):$PATH" # Use CMake from SDK - echo $PATH + #export PATH="$(dirname $ANDROID_SDK_ROOT/cmake/*/bin/.|tail -n1):$PATH" # Use CMake from SDK + #echo $PATH cmake --version ninja --version ./gradlew -PsplitApk=true -x lint -x lintVitalWebBeta assembleWebBeta uploadCrashlyticsSymbolFileWebBeta diff --git a/.github/workflows/android-check.yaml b/.github/workflows/android-check.yaml index 210011ca58..39a0df6564 100644 --- a/.github/workflows/android-check.yaml +++ b/.github/workflows/android-check.yaml @@ -1,12 +1,35 @@ -name: Check +name: Android Check on: pull_request: + paths-ignore: + - .github/workflows/linux* + - .github/workflows/ios* + - '**/*_tests/**' + - CONTRIBUTORS + - LICENSE + - NOTICE + - README.md + - docs/** + - generator/** + - iphone/** + - packaging/** + - pyhelpers/** + - qt*/** + - skin_generator/** + - track_generator/** + - xcode/** jobs: android-check: - name: Android Check + name: Build Android Debug runs-on: ubuntu-latest steps: + - name: Install build tools and dependencies + shell: bash + run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build + - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -17,25 +40,22 @@ jobs: - name: Parallel submodules checkout shell: bash - run: | - git submodule update --init --recursive --jobs=10 + run: git submodule update --init --recursive --jobs=$(($(nproc) * 2)) - name: Configure in Open Source mode shell: bash - run: | - ./configure.sh + run: ./configure.sh - name: Set up SDK shell: bash - run: | - (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT) + run: (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT) - name: Compile shell: bash working-directory: android run: | - export PATH="$(dirname $ANDROID_SDK_ROOT/cmake/*/bin/.|tail -n1):$PATH" # Use CMake from SDK - echo $PATH + #export PATH="$(dirname $ANDROID_SDK_ROOT/cmake/*/bin/.|tail -n1):$PATH" # Use CMake from SDK + #echo $PATH cmake --version ninja --version ./gradlew -Parm64 assembleWebDebug diff --git a/.github/workflows/desktop-check.yaml b/.github/workflows/desktop-check.yaml deleted file mode 100644 index 7fb02ec63b..0000000000 --- a/.github/workflows/desktop-check.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: Check -on: - pull_request: - -jobs: - desktop-check: - name: Desktop Check - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Parallel submodules checkout - shell: bash - run: | - git submodule update --init --recursive --jobs=10 - - - name: Configure - shell: bash - run: | - ./configure.sh - - - name: Install dependencies - shell: bash - run: | - sudo apt-get update && sudo apt-get install -y \ - build-essential \ - cmake \ - clang \ - ccache \ - python \ - qtbase5-dev \ - libqt5svg5-dev \ - libc++-dev \ - libboost-iostreams-dev \ - libglu1-mesa-dev \ - libsqlite3-dev \ - zlib1g-dev - - - name: Restore cache - uses: actions/cache@v2 - with: - path: ~/.ccache - key: desktop-cache - - - name: Compile - shell: bash - run: | - export PATH="/usr/lib/ccache:${PATH}" - ccache -M 4G - (mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make desktop -j $(($(nproc)*2))) - -# - name: Test -# shell: bash -# run: ./tools/python/run_desktop_tests.py -f build/ -e generator_integration_tests,opening_hours_integration_tests,opening_hours_supported_features_tests,routing_consistency_tests,routing_integration_tests,routing_quality_tests,storage_integration_tests diff --git a/.github/workflows/ios-check.yaml b/.github/workflows/ios-check.yaml index de1eeea619..f8cc937540 100644 --- a/.github/workflows/ios-check.yaml +++ b/.github/workflows/ios-check.yaml @@ -1,27 +1,39 @@ -name: Check +name: iOS Check on: pull_request: + paths-ignore: + - .github/workflows/android* + - .github/workflows/linux* + - '**/*_tests/**' + - '**/CMakeLists.txt' + - CONTRIBUTORS + - LICENSE + - NOTICE + - README.md + - android/** + - docs/** + - generator/** + - packaging/** + - pyhelpers/** + - qt*/** + - skin_generator/** + - track_generator/** jobs: ios-check: - name: iOS Check + name: Build iOS Debug runs-on: macos-latest steps: - name: Checkout sources uses: actions/checkout@v2 - with: - submodules: recursive + + - name: Parallel submodules checkout + shell: bash + run: git submodule update --init --recursive --jobs=4 - name: Configure shell: bash - run: | - ./configure.sh - - - name: Restore cache - uses: actions/cache@v2 - with: - path: ~/Library/Developer/Xcode/DerivedData/omim-*/Build - key: macos-cache + run: ./configure.sh - name: Compile shell: bash diff --git a/.github/workflows/linux-check.yaml b/.github/workflows/linux-check.yaml new file mode 100644 index 0000000000..3ec8549a16 --- /dev/null +++ b/.github/workflows/linux-check.yaml @@ -0,0 +1,88 @@ +name: Linux Check +on: + pull_request: + paths-ignore: + - .github/workflows/android* + - .github/workflows/ios* + - CONTRIBUTORS + - LICENSE + - NOTICE + - README.md + - android/** + - docs/** + - iphone/** + - packaging/** + - pyhelpers/** + - xcode/** + +jobs: + linux-debug: + name: Linux Debug Build and Test + runs-on: ubuntu-latest + env: + CC: gcc-10 + CXX: g++-10 + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Parallel submodules checkout + shell: bash + run: git submodule update --init --recursive --jobs=$(($(nproc) * 2)) + + - name: Install build tools and dependencies + shell: bash + run: | + sudo apt-get install -y \ + ninja-build \ + qtbase5-dev \ + libqt5svg5-dev + + - name: Configure + shell: bash + run: ./configure.sh + + - name: CMake + shell: bash + # -g1 should slightly reduce build time. + run: cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=-g1 + + - name: Compile + shell: bash + working-directory: build + run: ninja + + - name: Checkout world_feed_integration_tests_data + uses: actions/checkout@v2 + with: + repository: omapsapp/world_feed_integration_tests_data + path: data/world_feed_integration_tests_data + + - name: Tests + shell: bash + # generator_integration_tests - https://github.com/omapsapp/omapsapp/issues/225 + # partners_api_tests - https://github.com/omapsapp/omapsapp/issues/218 + # routing_integration_tests - https://github.com/omapsapp/omapsapp/issues/221 + # routing_quality_tests - https://github.com/omapsapp/omapsapp/issues/215 + # drape_tests - requires X Window + run: | + ./tools/python/run_desktop_tests.py \ + -f ./build \ + -u ./data \ + -d ./data \ + -e generator_integration_tests \ + -e partners_api_tests \ + -e routing_integration_tests \ + -e routing_quality_tests \ + -e world_feed_integration_tests \ + -e drape_tests \ + -e shaders_tests \ + \ + -e routing_tests \ + -e generator_tests \ + -e opening_hours_tests \ + -e opening_hours_integration_tests \ + -e routing_consistency_tests \ + -e opening_hours_supported_features_tests \ + -e storage_integration_tests \ diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 14041f3a9a..f54e305ce7 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -153,7 +153,37 @@ and run ### Testing -Run tests from the binary directory with `omapsapp/tools/unix/run_tests.sh`. +Compile all unit tests in Debug mode: + +```bash +cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug +cmake --build build --target all +``` + +Run all unit tests: + +```bash +cd build +../tools/python/run_desktop_tests.py -f . -u ../data/ -d ../data/ +``` + +To run a limited set of tests, use `-i` flag. To exclude some tests, use `-e` flag: + +```bash +cd build +../tools/python/run_desktop_tests.py -f . -u ../data/ -d ../data/ -i base_tests,coding_tests +../tools/python/run_desktop_tests.py -f . -u ../data/ -d ../data/ -e routing_integration_tests +``` + +When developing, it is more convenient to use a symlink: + +```bash +cd build +ln -s ../data/ data +./coding_tests +``` + +Some tests [are known to be broken](https://github.com/omapsapp/omapsapp/issues?q=is%3Aissue+is%3Aopen+label%3ATests). ## Android app diff --git a/tools/unix/run_tests.sh b/tools/unix/run_tests.sh old mode 100755 new mode 100644