diff --git a/.github/workflows/ci-4.x.yml b/.github/workflows/ci-4.x.yml new file mode 100644 index 00000000000..f54d164bfec --- /dev/null +++ b/.github/workflows/ci-4.x.yml @@ -0,0 +1,32 @@ +name: CI (4.x) +on: + schedule: + - cron: '0 4 * * *' +jobs: + CI: + strategy: + matrix: + include: + - os: ubuntu-latest + jdk: 8 + profile: '' + - os: ubuntu-latest + jdk: 8 + profile: '-PtestNativeTransport' + - os: ubuntu-latest + jdk: 8 + profile: '-PtestDomainSockets' + - os: ubuntu-latest + jdk: 17 + profile: '' + - os: windows-latest + jdk: 8 + profile: '' + uses: ./.github/workflows/ci.yml + with: + branch: 4.x + jdk: ${{ matrix.jdk }} + os: ${{ matrix.os }} + profile: ${{ matrix.profile }} + deploy: ${{ matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }} + secrets: inherit diff --git a/.github/workflows/ci-5.x.yml b/.github/workflows/ci-5.x.yml new file mode 100644 index 00000000000..282b95d48f7 --- /dev/null +++ b/.github/workflows/ci-5.x.yml @@ -0,0 +1,38 @@ +name: CI (5.x) +on: + push: + branches: + - master + pull_request: + branches: + - master + schedule: + - cron: '0 5 * * *' +jobs: + CI: + strategy: + matrix: + include: + - os: ubuntu-latest + jdk: 8 + profile: '' + - os: ubuntu-latest + jdk: 8 + profile: '-PtestNativeTransport' + - os: ubuntu-latest + jdk: 8 + profile: '-PtestDomainSockets' + - os: ubuntu-latest + jdk: 17 + profile: '' + - os: windows-latest + jdk: 8 + profile: '' + uses: ./.github/workflows/ci.yml + with: + branch: ${{ github.head_ref || github.ref_name }} + jdk: ${{ matrix.jdk }} + os: ${{ matrix.os }} + profile: ${{ matrix.profile }} + deploy: ${{ matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }} + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fe909de64b..9f9a69e9fd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,46 +1,37 @@ name: CI on: - push: - branches: - - master - - '[0-9]+.[0-9]+' - pull_request: - branches: - - master - - '[0-9]+.[0-9]+' - schedule: - - cron: '0 4 * * *' + workflow_call: + inputs: + branch: + required: true + type: string + jdk: + default: 8 + type: string + os: + default: ubuntu-latest + type: string + deploy: + type: boolean jobs: Test: name: Run tests - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - profile: [""] - jdk: [8] - include: - - os: ubuntu-latest - jdk: 17 - - os: ubuntu-latest - jdk: 8 - profile: '-PtestNativeTransport' - - os: ubuntu-latest - jdk: 8 - profile: '-PtestDomainSockets' - runs-on: ${{ matrix.os }} + runs-on: ${{ inputs.os }} steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ inputs.branch }} - name: Install JDK uses: actions/setup-java@v2 with: - java-version: ${{ matrix.jdk }} + java-version: ${{ inputs.jdk }} distribution: temurin - name: Run tests - run: mvn -s .github/maven-ci-settings.xml -q clean verify -B ${{ matrix.profile }} + run: mvn -s .github/maven-ci-settings.xml -q clean verify -B ${{ inputs.profile }} Deploy: name: Deploy to OSSRH - if: ${{ github.repository_owner == 'eclipse-vertx' && (github.event_name == 'push' || github.event_name == 'schedule') }} + if: ${{ inputs.deploy && github.repository_owner == 'eclipse-vertx' && (github.event_name == 'push' || github.event_name == 'schedule') }} needs: Test runs-on: ubuntu-latest env: @@ -52,7 +43,7 @@ jobs: - name: Install JDK uses: actions/setup-java@v2 with: - java-version: 8 + java-version: ${{ inputs.jdk }} distribution: temurin - name: Get project version run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV