Run nightly: buildAndPushRelease and smokeTestRelease.py #621
This file contains hidden or 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
name: "Run nightly: buildAndPushRelease and smokeTestRelease.py" | |
on: | |
# Allow manual dispatch. | |
workflow_dispatch: | |
# run nightly at 2:04am. | |
schedule: | |
- cron: '4 2 * * *' | |
permissions: {} | |
jobs: | |
smokeTestRelease: | |
name: "Smoke test release on jdk ${{ matrix.java-version }}, ${{ matrix.os }}" | |
permissions: | |
contents: write # may work with contents:read | |
# 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: [ '25' ] | |
runs-on: ${{ matrix.os }} | |
env: | |
LUCENE_RELEASE_DIR: /tmp/lucene-release-dir | |
TMP_DIR: /tmp/lucene-tmp-dir | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
with: | |
persist-credentials: false | |
- name: Setup java | |
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
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 }} | |
25 | |
- 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 "$JAVA_VERSION" | grep -E --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" | |
env: | |
JAVA_VERSION: ${{ matrix.java-version }} | |
- 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 "$LUCENE_RELEASE_DIR" | |
- name: "Run smokeTestRelease.py (runtime java: ${{ matrix.java-version }})" | |
run: | | |
subfolder=$(compgen -G "$LUCENE_RELEASE_DIR/lucene*") | |
subfolder=$(realpath "$subfolder") | |
python3 -u dev-tools/scripts/smokeTestRelease.py \ | |
--not-signed \ | |
--tmp-dir "$TMP_DIR" \ | |
"file://$subfolder" \ | |
-Ptests.filter="@skipall" | |
- name: "Store smoke tester logs" | |
if: ${{ always() }} | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: smoke-tester-logs-jdk-${{ matrix.java-version }} | |
path: | | |
${{ env.TMP_DIR }}/**/*.log | |
/tmp/release.log |