You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2024/06/06 13:43:18 UTC
(lucene) branch branch_9x updated: Backport gh workflow cleanups to branch_9x #13461
This is an automated email from the ASF dual-hosted git repository.
dweiss pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 8fda92efc44 Backport gh workflow cleanups to branch_9x #13461
8fda92efc44 is described below
commit 8fda92efc44324c74770e471cd32d608e74690b5
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Thu Jun 6 15:43:11 2024 +0200
Backport gh workflow cleanups to branch_9x #13461
---
.github/actions/gradle-caches/action.yml | 15 -----
.github/actions/prepare-for-build/action.yml | 29 ++++++++
.github/workflows/distribution.yml | 43 ------------
.github/workflows/gradle-precommit.yml | 78 ----------------------
.github/workflows/hunspell.yml | 32 ---------
.github/workflows/mark-stale-PRs.yml | 50 ++++++++++++++
.github/workflows/run-checks-all.yml | 67 +++++++++++++++++++
.../workflows/run-checks-mod-analysis-common.yml | 37 ++++++++++
.../run-checks-mod-distribution.tests.yml | 36 ++++++++++
9 files changed, 219 insertions(+), 168 deletions(-)
diff --git a/.github/actions/gradle-caches/action.yml b/.github/actions/gradle-caches/action.yml
deleted file mode 100644
index 488e504c2c1..00000000000
--- a/.github/actions/gradle-caches/action.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: "Set up caches"
-description: "Set up cached resources"
-
-runs:
- using: "composite"
- steps:
- - name: Cache/Restore cached gradle files
- uses: actions/cache@v2
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/jdks
- key: ${{ runner.os }}-gradle-caches-${{ hashFiles('versions.lock', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-caches-
diff --git a/.github/actions/prepare-for-build/action.yml b/.github/actions/prepare-for-build/action.yml
new file mode 100644
index 00000000000..92e751f60bb
--- /dev/null
+++ b/.github/actions/prepare-for-build/action.yml
@@ -0,0 +1,29 @@
+# This composite action is included in other workflows to have a shared setup
+# for java, gradle, caches, etc.
+
+name: Prepare Lucene build
+
+inputs:
+ java-version:
+ required: false
+ default: 17
+ description: "The default JDK version to set up."
+
+ java-distribution:
+ required: false
+ default: "temurin"
+ description: "The default JDK distribution type"
+
+runs:
+ using: "composite"
+ steps:
+ - name: Set up Java (${{ inputs.java-distribution }}, ${{ inputs.java-version }})"
+ uses: actions/setup-java@v4
+ with:
+ distribution: ${{ inputs.java-distribution }}
+ java-version: ${{ inputs.java-version }}
+ java-package: jdk
+
+ # This includes "smart" caching of the wrapper and dependencies.
+ - name: Set up Gradle
+ uses: gradle/actions/setup-gradle@v3
diff --git a/.github/workflows/distribution.yml b/.github/workflows/distribution.yml
deleted file mode 100644
index ce950376b0a..00000000000
--- a/.github/workflows/distribution.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: Distribution tests
-
-on:
- # Allow manual triggers for testing the action.
- workflow_dispatch:
-
- pull_request:
- branches:
- - 'main'
-
- push:
- branches:
- - 'main'
- - 'branch_9x'
-
-permissions:
- contents: read # to fetch code (actions/checkout)
-
-jobs:
- test:
- name: Run distribution tests
- timeout-minutes: 15
-
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- # we want to run the distribution tests on all major OSs, but it's occasionally too slow (or hangs or the forked process is not started at all..., not sure the cause) on windows.
- #os: [ubuntu-latest, macos-latest, windows-latest]
- os: [ubuntu-latest, macos-latest]
-
- steps:
- - uses: actions/checkout@v3
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- distribution: 'temurin'
- java-version: 17
- java-package: jdk
- - name: Prepare caches
- uses: ./.github/actions/gradle-caches
-
- - name: Run all distribution tests including GUI tests (${{ matrix.os }})
- run: ./gradlew -p lucene/distribution.tests test
diff --git a/.github/workflows/gradle-precommit.yml b/.github/workflows/gradle-precommit.yml
deleted file mode 100644
index 83bbba8d950..00000000000
--- a/.github/workflows/gradle-precommit.yml
+++ /dev/null
@@ -1,78 +0,0 @@
-name: Gradle Precommit Checks
-
-on:
- pull_request:
- branches:
- - '*'
-
- push:
- branches:
- - main
- - branch_9x
-
-permissions:
- contents: read # to fetch code (actions/checkout)
-
-jobs:
- # This runs all validation checks without tests.
- checks:
- name: gradle check -x test (JDK ${{ matrix.java }} on ${{ matrix.os }})
- timeout-minutes: 15
- runs-on: ${{ matrix.os }}
-
- strategy:
- matrix:
- # Operating systems to run on.
- os: [ubuntu-latest]
- # Test JVMs.
- java: [ '11' ]
-
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- distribution: 'adopt-hotspot'
- java-version: ${{ matrix.java }}
- java-package: jdk
-
- - name: Prepare caches
- uses: ./.github/actions/gradle-caches
-
- - name: Run gradle check (without tests)
- run: ./gradlew check -x test -Ptask.times=true --max-workers 2
-
- # This runs all tests without any other validation checks.
- tests:
- name: gradle test (JDK ${{ matrix.java }} on ${{ matrix.os }})
- timeout-minutes: 30
- runs-on: ${{ matrix.os }}
-
- strategy:
- matrix:
- # Operating systems to run on.
- # windows-latest: fairly slow to build and results in odd errors (see LUCENE-10167)
- # macos-latest: a tad slower than ubuntu and pretty much the same (?) so leaving out.
- os: [ubuntu-latest]
- # Test JVMs.
- java: [ '11' ]
-
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- distribution: 'adopt-hotspot'
- java-version: ${{ matrix.java }}
- java-package: jdk
-
- - name: Prepare caches
- uses: ./.github/actions/gradle-caches
-
- - name: Run gradle tests
- run: ./gradlew test "-Ptask.times=true" --max-workers 2
-
- - name: Echo settings
- run: cat gradle.properties
diff --git a/.github/workflows/hunspell.yml b/.github/workflows/hunspell.yml
deleted file mode 100644
index 37b8f7fb182..00000000000
--- a/.github/workflows/hunspell.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Hunspell regression tests
-
-on:
- pull_request:
- branches:
- - 'main'
- paths:
- - '.github/workflows/hunspell.yml'
- - 'lucene/analysis/common/**'
-
-jobs:
- test:
- name: Run Hunspell regression tests
- timeout-minutes: 15
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
-
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- distribution: 'temurin'
- java-version: 17
- java-package: jdk
-
- - name: Prepare caches
- uses: ./.github/actions/gradle-caches
-
- - name: Run regular and regression tests
- run: ./gradlew -p lucene/analysis/common check testRegressions
diff --git a/.github/workflows/mark-stale-PRs.yml b/.github/workflows/mark-stale-PRs.yml
new file mode 100644
index 00000000000..a4aa007c9d8
--- /dev/null
+++ b/.github/workflows/mark-stale-PRs.yml
@@ -0,0 +1,50 @@
+# This workflow warns of PRs that have had no activity for a specified amount of time.
+#
+# For more information, see https://github.com/actions/stale
+name: Mark stale pull requests
+
+on:
+ # Run every day at 00:00 UTC
+ schedule:
+ - cron: '0 0 * * *'
+ # Or run on demand
+ workflow_dispatch:
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+
+ permissions:
+ pull-requests: write
+
+ steps:
+ - uses: actions/stale@v5
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+
+ days-before-pr-stale: 14
+ days-before-issue-stale: -1 # don't mark issues as stale
+ exempt-draft-pr: true # don't mark draft PRs as stale
+
+ days-before-close: -1 # don't close stale PRs/issues
+
+ stale-pr-message: >
+ This PR has not had activity in the past 2 weeks, labeling it as stale.
+ If the PR is waiting for review, notify the dev@lucene.apache.org list.
+ Thank you for your contribution!
+
+ debug-only: false # turn on to run the action without applying changes
+ operations-per-run: 500 # operations budget
+
+# The table shows the cost in operations of all combinations of stale / not-stale for a PR.
+# Processing a non-PR issue takes 0 operations, since we don't perform any action on it.
+#
+# +-----------------------+
+# number of | state after workflow |
+# operations +-----------+-----------+
+# | stale | not stale |
+# +----------+-----------+-----------+-----------+
+# | state | stale | 3 | 4 |
+# | before +-----------+-----------+-----------+
+# | workflow | not stale | 5 | 1 |
+# +----------+-----------+-----------+-----------+
diff --git a/.github/workflows/run-checks-all.yml b/.github/workflows/run-checks-all.yml
new file mode 100644
index 00000000000..98248c9ad7d
--- /dev/null
+++ b/.github/workflows/run-checks-all.yml
@@ -0,0 +1,67 @@
+name: "Run checks: all modules"
+
+on:
+ workflow_dispatch:
+
+ pull_request:
+ branches:
+ - '*'
+
+ push:
+ branches:
+ - 'main'
+ - 'branch_9x'
+
+env:
+ GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
+# We split the workflow into two parallel jobs for efficiency:
+# one is running all validation checks without tests,
+# the other runs all tests without other validation checks.
+
+jobs:
+
+ # This runs all validation checks without tests.
+ checks:
+ name: checks without tests (JDK ${{ matrix.java }} on ${{ matrix.os }})
+ timeout-minutes: 15
+
+ strategy:
+ matrix:
+ os: [ ubuntu-latest ]
+ java: [ '17' ]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Run gradle check (without tests)
+ run: ./gradlew check -x test -Ptask.times=true --max-workers 2
+
+
+ # This runs all tests without any other validation checks.
+ tests:
+ name: tests (JDK ${{ matrix.java }} on ${{ matrix.os }})
+ timeout-minutes: 30
+
+ strategy:
+ matrix:
+ # Operating systems to run on.
+ # windows-latest: fairly slow to build and results in odd errors (see LUCENE-10167)
+ # macos-latest: a tad slower than ubuntu and pretty much the same (?) so leaving out.
+ os: [ ubuntu-latest ]
+ java: [ '17' ]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Run gradle tests
+ run: ./gradlew test "-Ptask.times=true" --max-workers 2
+
+ - name: List automatically-initialized gradle.properties
+ run: cat gradle.properties
diff --git a/.github/workflows/run-checks-mod-analysis-common.yml b/.github/workflows/run-checks-mod-analysis-common.yml
new file mode 100644
index 00000000000..df83212757c
--- /dev/null
+++ b/.github/workflows/run-checks-mod-analysis-common.yml
@@ -0,0 +1,37 @@
+name: "Run checks: module lucene/analysis/common"
+
+on:
+ workflow_dispatch:
+
+ pull_request:
+ branches:
+ - 'main'
+ - 'branch_9x'
+ paths:
+ - '.github/workflows/run-checks-mod-analysis-common.yml'
+ - 'lucene/analysis/common/**'
+
+ push:
+ branches:
+ - 'main'
+ - 'branch_9x'
+ paths:
+ - '.github/workflows/run-checks-mod-analysis-common.yml'
+ - 'lucene/analysis/common/**'
+
+env:
+ GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
+jobs:
+ test:
+ name: Extra regression tests
+ timeout-minutes: 15
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Run 'gradlew lucene/analysis/common check testRegressions'
+ run: ./gradlew -p lucene/analysis/common check testRegressions
diff --git a/.github/workflows/run-checks-mod-distribution.tests.yml b/.github/workflows/run-checks-mod-distribution.tests.yml
new file mode 100644
index 00000000000..497382d7579
--- /dev/null
+++ b/.github/workflows/run-checks-mod-distribution.tests.yml
@@ -0,0 +1,36 @@
+name: "Run checks: module lucene/distribution.tests"
+
+on:
+ workflow_dispatch:
+
+ pull_request:
+ branches:
+ - 'main'
+ - 'branch_9x'
+
+ push:
+ branches:
+ - 'main'
+ - 'branch_9x'
+
+env:
+ GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
+jobs:
+ test:
+ timeout-minutes: 15
+
+ strategy:
+ matrix:
+ # ubuntu-latest is checked as part of run-checks-everything.yml
+ # windows-latest is slow and sometimes flaky.
+ os: [ macos-latest ]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Run 'gradlew lucene/distribution.tests test' (on ${{ matrix.os }})
+ run: ./gradlew -p lucene/distribution.tests test