Testing zero-copy bugs fixes (not for merging) #3511
Workflow file for this run
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
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: build-branch | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
tags: | |
- '**' | |
pull_request: | |
env: | |
WITH_COVERAGE: true | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Cache for maven dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- name: Run a full build | |
run: ./dev-support/checks/build.sh -Prelease | |
- name: Store binaries for tests | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ratis-bin | |
path: | | |
ratis-assembly/target/ratis-assembly-*.tar.gz | |
!ratis-assembly/target/ratis-assembly-*-src.tar.gz | |
retention-days: 1 | |
- name: Store source tarball for compilation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ratis-src | |
path: ratis-assembly/target/ratis-assembly-*-src.tar.gz | |
retention-days: 1 | |
compile: | |
needs: | |
- build | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
java: [ 11, 17, 21 ] | |
fail-fast: false | |
steps: | |
- name: Download source tarball | |
uses: actions/download-artifact@v4 | |
with: | |
name: ratis-src | |
- name: Untar sources | |
run: | | |
tar --strip-components 1 -xzvf ratis-assembly-*-src.tar.gz | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Run a full build | |
run: ./dev-support/checks/build.sh -Djavac.version=${{ matrix.java }} | |
- name: Test reproducibility | |
run: ./dev-support/checks/repro.sh -Djavac.version=${{ matrix.java }} | |
rat: | |
name: rat | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Run tests | |
run: ./dev-support/checks/rat.sh | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: rat | |
path: target/rat | |
author: | |
name: author | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Run tests | |
run: ./dev-support/checks/author.sh | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: author | |
path: target/author | |
unit: | |
name: unit | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
profile: | |
- grpc | |
- server | |
- misc | |
fail-fast: false | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- name: Run tests | |
run: ./dev-support/checks/unit.sh -P${{ matrix.profile }}-tests | |
- name: Summary of failures | |
run: cat target/${{ github.job }}/summary.txt | |
if: ${{ !cancelled() }} | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: unit-${{ matrix.profile }} | |
path: target/unit | |
checkstyle: | |
name: checkstyle | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Run tests | |
run: ./dev-support/checks/checkstyle.sh | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: checkstyle | |
path: target/checkstyle | |
findbugs: | |
name: findbugs | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
steps: | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Run tests | |
run: ./dev-support/checks/findbugs.sh | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: findbugs | |
path: target/findbugs | |
coverage: | |
needs: | |
- build | |
- unit | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
if: (github.repository == 'apache/ratis' || github.repository == 'apache/incubator-ratis') && github.event_name != 'pull_request' | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache for maven dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/org/apache/ratis | |
key: maven-repo-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
maven-repo- | |
- name: Setup java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: target/artifacts | |
- name: Untar binaries | |
run: | | |
mkdir -p ratis-assembly/target | |
tar xzvf target/artifacts/ratis-bin/ratis-assembly-*.tar.gz -C ratis-assembly/target | |
- name: Calculate combined coverage | |
run: ./dev-support/checks/coverage.sh | |
- name: Upload coverage to Sonar | |
run: ./dev-support/checks/sonar.sh | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive build results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ github.job }} | |
path: target/${{ github.job }} |