All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates..github.workflows.ci-build-native-build.yml Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
name: CI Build
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  build:
    name: Build native-image on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
    concurrency:
      group: ${{ github.workflow }}-${{ matrix.os }}-${{ github.ref }}
      cancel-in-progress: true
    steps:
      - name: Free Disk Space
        run: |
          sudo rm -rf /usr/local/lib/android
          sudo rm -rf /usr/share/dotnet
      - name: Checkout the repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: graalvm/setup-graalvm@v1
        with:
          version: "21.2.0"
          java-version: "11"
          components: "native-image"
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - name: Enable testcontainer reuse
        run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties"
      - name: Cache local Maven repository
        uses: actions/cache@v3
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Run tests and build with Maven
        run: mvn --batch-mode --update-snapshots clean verify --file pom.xml -DtrimStackTrace=false
      - name: Cache SonarCloud packages
        uses: actions/cache@v3
        with:
          path: ~/.sonar/cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Sonar analysis
        if: ${{ env.SONAR_TOKEN != null && matrix.os == 'ubuntu-latest' }}
        run: |
          mvn --batch-mode sonar:sonar \
              -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
              -DtrimStackTrace=false \
              -Dsonar.organization=exasol \
              -Dsonar.host.url=https://sonarcloud.io \
              -Dsonar.token=$SONAR_TOKEN
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      - name: Upload binary
        uses: actions/upload-artifact@v3
        with:
          name: executable-${{ matrix.os }}
          path: target/${{ github.event.repository.name }}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy