Continuous Integration #2722
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.java.installations.auto-detect=false -Dorg.gradle.warning.mode=fail' | |
permissions: | |
contents: read | |
jobs: | |
java-build: | |
name: Java ${{ matrix.java }} (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ '17', '21' ] | |
os: [ 'ubuntu-24.04' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-caches- | |
- name: Cache Gradle wrappers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
java -Xinternalversion | |
echo "BUILD_JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
echo "BUILD_JAVA_VERSION=${{ matrix.java }}" >> $GITHUB_ENV | |
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
java -Xinternalversion | |
echo "BUILD_JAVA_HOME=$env:JAVA_HOME" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "BUILD_JAVA_VERSION=${{ matrix.java }}" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Setup java 17 to run the Gradle script | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Build with Gradle | |
run: ./gradlew | |
- name: Copy test logs | |
id: copy_test_logs | |
if: failure() | |
run: | | |
echo "::set-output name=file::build/distributions/test_logs.tbz2" | |
./gradlew tarTestLogs | |
- name: Upload crash logs | |
if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crash-logs-${{ matrix.os }}-java-${{ matrix.java }} | |
path: ${{ steps.copy_test_logs.outputs.file }} | |
cpp-gcc-build: | |
name: C++ GCC ${{ matrix.version }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [ '12' ] | |
env: | |
CC: gcc-${{ matrix.version }} | |
CXX: g++-${{ matrix.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-caches- | |
- name: Cache Gradle wrappers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper | |
- name: Setup java 17 to run the Gradle script | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Install compiler | |
run: | | |
sudo apt-get update || true | |
sudo apt-get install -y g++-${{ matrix.version }} libbsd-dev uuid-dev cmake | |
- name: Build | |
run: cppbuild/cppbuild | |
- name: Copy test logs | |
id: copy_test_logs | |
if: failure() | |
run: | | |
echo "::set-output name=file::build/distributions/test_logs.tbz2" | |
./gradlew tarTestLogs | |
- name: Upload crash logs | |
if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crash-logs-${{ matrix.os }}-gcc-${{ matrix.version }} | |
path: ${{ steps.copy_test_logs.outputs.file }} | |
cpp-clang-build: | |
name: C++ Clang ${{ matrix.version }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [ '15' ] | |
env: | |
CC: clang-${{ matrix.version }} | |
CXX: clang++-${{ matrix.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-caches- | |
- name: Cache Gradle wrappers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper | |
- name: Setup java 17 to run the Gradle script | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Install compiler | |
run: | | |
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.version }} main" | |
sudo apt-get update || true | |
sudo apt-get install -y clang-${{ matrix.version }} libbsd-dev uuid-dev cmake | |
- name: Build | |
run: cppbuild/cppbuild | |
- name: Upload crash logs | |
if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crash-logs-${{ matrix.os }}-clang-${{ matrix.version }} | |
path: ${{ steps.copy_test_logs.outputs.file }} |