This message was deleted.
# community-support
s
This message was deleted.
j
build.yml
Copy code
name: Build

on:
  push:
    branches:
      - MiPece2.0

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Cache SonarQube packages
        uses: actions/cache@v1
        with:
          path: ~/.sonar/cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Cache Gradle packages
        uses: actions/cache@v1
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
          restore-keys: ${{ runner.os }}-gradle
      - name: Build and analyze
        env:
          SONAR_TOKEN: XXX
          SONAR_HOST_URL: <https://sonarqube.mipece.com>
        run: ./gradlew build sonar --info
Now I can see
> No version of NDK matched the requested version 20.0.5594570. Versions available locally: 23.2.8568313, 24.0.8215888, 25.2.9519653, 25.2.9519653
g
You'll have to install NDK and other dependencies (like ancient android sdk versions) in another step before running
./gradlew build sonar
. GitHub runners have a lot of software installed but wouldn't bring all the version by themselves, see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software. For example
ubuntu-latest
has NDK 23, 24 and 25. Also I'd recommend to use https://github.com/gradle/wrapper-validation-action (usually in another job with
build
job depending on it using
needs
) and https://github.com/gradle/gradle-build-action to configure correct gradle version and manage its caches (gradle dist, dependencies, wrapper and local build cache if you use it).
🙌 1