Skip to content

Commit

Permalink
Add a nightly workflow to run and verify buildAndPushRelease.py and s…
Browse files Browse the repository at this point in the history
…mokeTestRelease.py (#13141)
  • Loading branch information
dweiss committed Feb 28, 2024
1 parent 4226920 commit 390c109
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 3 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/run-nightly-smoketester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Run nightly: buildAndPushRelease and smokeTestRelease.py"

on:
# Allow manual dispatch.
workflow_dispatch:

# run nightly at 2:04am.
schedule:
- cron: '4 2 * * *'

jobs:
smokeTestRelease:
name: "Smoke test release on jdk ${{ matrix.java-version }}, ${{ matrix.os }}"

# only run on schedule in the main Lucene repo (not in forks).
if: (github.event_name == 'schedule' && github.repository == 'apache/lucene') || (github.event_name != 'schedule')

strategy:
matrix:
os: [ ubuntu-latest ]
java-version: [ '17', '21', '22-ea' ]

runs-on: ${{ matrix.os }}

env:
LUCENE_RELEASE_DIR: /tmp/lucene-release-dir
TMP_DIR: /tmp/lucene-tmp-dir

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-package: jdk
check-latest: true
# This intentionally lists two versions, the last one is used as the system default (for running gradle).
java-version: |
${{ matrix.java-version }}
17
- name: Echo diagnostic paths and locations
run: |
echo "All installed JDKs:"
set | grep "JAVA"
echo "Gradle's 'RUNTIME_JAVA_HOME' JDK:"
RUNTIME_JAVA_HOME_VAR=JAVA_HOME_`echo ${{ matrix.java-version }} | egrep --only "[0-9]+"`_X64
echo ${RUNTIME_JAVA_HOME_VAR} points at ${!RUNTIME_JAVA_HOME_VAR}
# This sets the environment variable and makes it available for subsequent job steps.
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
echo "RUNTIME_JAVA_HOME=${!RUNTIME_JAVA_HOME_VAR}" >> "$GITHUB_ENV"
- name: "Run buildAndPushRelease.py (--dev-mode)"
run: |
# Assemble an unsigned release, in dev mode, publish locally.
python3 ./dev-tools/scripts/buildAndPushRelease.py --dev-mode --push-local ${{ env.LUCENE_RELEASE_DIR }}
- name: "Run smokeTestRelease.py (runtime java: ${{ matrix.java-version }})"
run: |
python3 -u dev-tools/scripts/smokeTestRelease.py \
--not-signed \
--tmp-dir ${{ env.TMP_DIR }} \
file://`realpath ${{ env.LUCENE_RELEASE_DIR }}/lucene*` \
-Ptests.filter="@skipall"
- name: "Store smoke tester logs"
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: smoke-tester-logs-jdk-${{ matrix.java-version }}
path: |
${{ env.TMP_DIR }}/**/*.log
6 changes: 3 additions & 3 deletions dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def checkJARMetaData(desc, jarFile, gitRevision, version):
break
else:
if len(verify) == 1:
raise RuntimeError('%s is missing "%s" inside its META-INF/MANIFEST.MF' % (desc, verify[0]))
raise RuntimeError('%s is missing "%s" inside its META-INF/MANIFEST.MF: %s' % (desc, verify[0], s))
else:
raise RuntimeError('%s is missing one of "%s" inside its META-INF/MANIFEST.MF' % (desc, verify))
raise RuntimeError('%s is missing one of "%s" inside its META-INF/MANIFEST.MF: %s' % (desc, verify, s))

if gitRevision != 'skip':
# Make sure this matches the version and git revision we think we are releasing:
Expand Down Expand Up @@ -577,7 +577,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):
# raise RuntimeError('lucene: file "%s" is missing from artifact %s' % (fileName, artifact))
# in_root_folder.remove(fileName)

expected_folders = ['analysis', 'analysis.tests', 'backward-codecs', 'benchmark', 'classification', 'codecs', 'core', 'core.tests',
expected_folders = ['analysis', 'analysis.tests', 'backward-codecs', 'benchmark', 'benchmark-jmh', 'classification', 'codecs', 'core', 'core.tests',
'distribution.tests', 'demo', 'expressions', 'facet', 'grouping', 'highlighter', 'join',
'luke', 'memory', 'misc', 'monitor', 'queries', 'queryparser', 'replicator',
'sandbox', 'spatial-extras', 'spatial-test-fixtures', 'spatial3d', 'suggest', 'test-framework', 'licenses']
Expand Down

0 comments on commit 390c109

Please sign in to comment.