Update build.yml

para usar sonarqube
This commit is contained in:
OAlbuja 2024-05-13 01:56:14 -05:00 committed by GitHub
parent b35641f4a3
commit fa9706fd01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 33 additions and 95 deletions

View File

@ -1,100 +1,38 @@
name: Build name: Build
on: on:
pull_request:
push: push:
branches: [ ci, master, latest, 3.3-stable ] branches:
workflow_dispatch: - main
permissions:
statuses: write
contents: read
jobs: jobs:
build-linux-clang: build:
name: Linux (Clang) name: Build and analyze
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 4
env:
CC: clang
CFLAGS: -Werror
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install dependencies with:
run: | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
sudo apt update - name: Set up JDK 17
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev uses: actions/setup-java@v1
with:
- name: Configure Null shared library java-version: 17
run: cmake -B build-null-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON - name: Cache SonarQube packages
- name: Build Null shared library uses: actions/cache@v1
run: cmake --build build-null-shared --parallel with:
path: ~/.sonar/cache
- name: Configure X11 shared library key: ${{ runner.os }}-sonar
run: cmake -B build-x11-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=ON -D BUILD_SHARED_LIBS=ON restore-keys: ${{ runner.os }}-sonar
- name: Build X11 shared library - name: Cache Maven packages
run: cmake --build build-x11-shared --parallel uses: actions/cache@v1
with:
- name: Configure Wayland shared library path: ~/.m2
run: cmake -B build-wayland-shared -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build Wayland shared library restore-keys: ${{ runner.os }}-m2
run: cmake --build build-wayland-shared --parallel - name: Build and analyze
- name: Configure Wayland+X11 static library
run: cmake -B build-full-static -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=ON
- name: Build Wayland+X11 static library
run: cmake --build build-full-static --parallel
- name: Configure Wayland+X11 shared library
run: cmake -B build-full-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_X11=ON
- name: Build Wayland+X11 shared library
run: cmake --build build-full-shared --parallel
build-macos-clang:
name: macOS (Clang)
runs-on: macos-latest
timeout-minutes: 4
env: env:
CFLAGS: -Werror SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MACOSX_DEPLOYMENT_TARGET: 10.11 SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
CMAKE_OSX_ARCHITECTURES: x86_64;arm64 run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=knn1 -Dsonar.projectName='knn1'
steps:
- uses: actions/checkout@v4
- name: Configure Null shared library
run: cmake -B build-null-shared -D GLFW_BUILD_COCOA=OFF -D BUILD_SHARED_LIBS=ON
- name: Build Null shared library
run: cmake --build build-null-shared --parallel
- name: Configure Cocoa static library
run: cmake -B build-cocoa-static
- name: Build Cocoa static library
run: cmake --build build-cocoa-static --parallel
- name: Configure Cocoa shared library
run: cmake -B build-cocoa-shared -D BUILD_SHARED_LIBS=ON
- name: Build Cocoa shared library
run: cmake --build build-cocoa-shared --parallel
build-windows-vs2022:
name: Windows (VS2022)
runs-on: windows-latest
timeout-minutes: 4
env:
CFLAGS: /WX
steps:
- uses: actions/checkout@v4
- name: Configure Win32 shared x86 library
run: cmake -B build-win32-shared-x86 -G "Visual Studio 17 2022" -A Win32 -D BUILD_SHARED_LIBS=ON
- name: Build Win32 shared x86 library
run: cmake --build build-win32-shared-x86 --parallel
- name: Configure Win32 static x64 library
run: cmake -B build-win32-static-x64 -G "Visual Studio 17 2022" -A x64
- name: Build Win32 static x64 library
run: cmake --build build-win32-static-x64 --parallel
- name: Configure Win32 shared x64 library
run: cmake -B build-win32-shared-x64 -G "Visual Studio 17 2022" -A x64 -D BUILD_SHARED_LIBS=ON
- name: Build Win32 shared x64 library
run: cmake --build build-win32-shared-x64 --parallel