Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github workflow cleanup and minor improvements #13110

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/actions/gradle-caches/action.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/actions/prepare-for-build/action.yml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 0 additions & 44 deletions .github/workflows/distribution.yml

This file was deleted.

84 changes: 0 additions & 84 deletions .github/workflows/gradle-precommit.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/hunspell.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ on:

jobs:
stale:

runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- 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-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
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!
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
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.
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/run-checks-all.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions .github/workflows/run-checks-mod-analysis-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Run checks: module lucene/analysis/common"

on:
workflow_dispatch:

pull_request:
branches:
- 'main'
- 'branch_9x'
paths:
- '.github/workflows/hunspell.yml'
- 'lucene/analysis/common/**'

push:
branches:
- 'main'
- 'branch_9x'
paths:
- '.github/workflows/hunspell.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
36 changes: 36 additions & 0 deletions .github/workflows/run-checks-mod-distribution.tests.yml
Original file line number Diff line number Diff line change
@@ -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