Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5d90948
[ci] generate valgrind suppressions in logs
jameslamb Oct 21, 2025
2427c14
comment out most CI
jameslamb Oct 21, 2025
1889bbb
some updates, comment out most CI
jameslamb Oct 25, 2025
ff3401e
restore only-run-on-GitHub-actions stuff
jameslamb Oct 25, 2025
b269786
try using run-name
jameslamb Oct 25, 2025
c066a9a
more changes
jameslamb Oct 26, 2025
5eac15d
more updates
jameslamb Oct 31, 2025
1c673bb
merge master
jameslamb Nov 8, 2025
27eb1f6
merge master
jameslamb Nov 8, 2025
c4a6d54
more fixes
jameslamb Nov 8, 2025
45071c0
fix workflow status
jameslamb Nov 8, 2025
c95b1ce
small fixes, test that this works when the workflow run fails
jameslamb Nov 8, 2025
b565c45
add notes on GitHub CLI, fix trigger to re-run optional checks workflow
jameslamb Nov 8, 2025
9f55186
Merge branch 'ci/fix-rerun-workflow' into ci/valgrind-suppressions
jameslamb Nov 10, 2025
de7cfb1
fix line endings
jameslamb Nov 10, 2025
49e5ade
use curl instead of wget
jameslamb Nov 10, 2025
9b3d699
workflow rerun needs more permissions
jameslamb Nov 10, 2025
cae3253
Merge branch 'ci/fix-rerun-workflow' into ci/valgrind-suppressions
jameslamb Nov 10, 2025
5029294
restore all CI
jameslamb Nov 10, 2025
2f5ba65
shellcheck
jameslamb Nov 10, 2025
b528124
Merge branch 'ci/fix-rerun-workflow' into ci/valgrind-suppressions
jameslamb Nov 10, 2025
079ce4d
short-circuit
jameslamb Nov 10, 2025
220d249
exit 0
jameslamb Nov 10, 2025
7e4a523
merge master
jameslamb Nov 11, 2025
9f8cc6e
remove debugging code
jameslamb Nov 11, 2025
4d5a90c
update branch
jameslamb Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .appveyor.yml

This file was deleted.

17 changes: 11 additions & 6 deletions .ci/check-workflow-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,25 @@ set -e -u -o pipefail

BRANCH="${1}"
WORKFLOW_FILE="${2}"
PR_NUMBER="${3}"

echo "Searching for latest run of '${WORKFLOW_FILE}' on branch '${BRANCH}'"
# Limit how much data is pulled from the API and needs to be parsed locally.
OLDEST_ALLOWED_RUN_DATE=$(date --date='7 days ago' '+%F')

echo "Searching for latest run of '${WORKFLOW_FILE}' on branch '${BRANCH}' "

LATEST_RUN_ID=$(
gh run list \
--repo "microsoft/LightGBM" \
--branch "${BRANCH}" \
--repo 'microsoft/LightGBM' \
--event 'workflow_dispatch' \
--created ">= ${OLDEST_ALLOWED_RUN_DATE}" \
--workflow "${WORKFLOW_FILE}" \
--json 'createdAt,databaseId' \
--jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId'
--json 'createdAt,databaseId,name' \
--jq "sort_by(.createdAt) | reverse | map(select(.name | contains (\"pr=${PR_NUMBER}\"))) | .[0] | .databaseId"
)

if [[ "${LATEST_RUN_ID}" == "" ]]; then
echo "No runs of '${WORKFLOW_FILE}' found on branch '${BRANCH}'"
echo "No runs of '${WORKFLOW_FILE}' found on branch from pull request ${PR_NUMBER} (on or after ${OLDEST_ALLOWED_RUN_DATE})."
exit 0
fi

Expand Down
50 changes: 30 additions & 20 deletions .ci/rerun-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,39 @@ if [ -z "$GITHUB_ACTIONS" ]; then
exit 1
fi

if [ $# -ne 3 ]; then
echo "Usage: $0 <WORKFLOW_ID> <PR_NUMBER> <PR_BRANCH>"
if [ $# -ne 2 ]; then
echo "Usage: $0 <WORKFLOW_ID> <PR_BRANCH>"
exit 1
fi

workflow_id=$1
pr_number=$2
pr_branch=$3

runs=$(
curl -sL \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
"${GITHUB_API_URL}/repos/microsoft/LightGBM/actions/workflows/${workflow_id}/runs?event=pull_request&branch=${pr_branch}" | \
jq '.workflow_runs'
pr_branch=$2

# --branch for some GitHub GLI commands does not respect the difference between forks and branches
# on the main repo. While some parts of the GitHub API refer to the branch of a workflow
# as '{org}:{branch}' for branches from forks, others expect only '{branch}'.
#
# This expansion trims a leading '{org}:' from 'pr_branch' if one is present.
pr_branch_no_fork_prefix="${pr_branch/*:/}"

EXPECTED_RUN_NAME="R valgrind tests (pr-number=7068)"
RUN_ID=$(
gh run list \
--repo 'microsoft/LightGBM' \
--workflow "${workflow_id}" \
--event "pull_request" \
--branch "${pr_branch_no_fork_prefix}" \
--json 'createdAt,databaseId' \
--jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId'
)
runs=$(echo "${runs}" | jq --arg pr_number "${pr_number}" --arg pr_branch "${pr_branch}" 'map(select(.event == "pull_request" and ((.pull_requests | length) != 0 and (.pull_requests[0].number | tostring) == $pr_number or .head_branch == $pr_branch)))')
runs=$(echo "${runs}" | jq 'sort_by(.run_number) | reverse')

if [[ $(echo "${runs}" | jq 'length') -gt 0 ]]; then
curl -sL \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
"${GITHUB_API_URL}/repos/microsoft/LightGBM/actions/runs/$(echo "${runs}" | jq '.[0].id')/rerun"

if [[ -z "${RUN_ID}" ]]; then
echo "ERROR: failed to find a run of workflow '${workflow_id}' for branch '${branch}'"
exit 1
fi

echo "Re-running workflow '${workflow_id}' (run ID ${RUN_ID})"

gh run rerun \
--repo 'microsoft/LightGBM' \
"${RUN_ID}"
5 changes: 4 additions & 1 deletion .ci/test-r-package-valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e -E -u -o pipefail

# TODO: remove before merging
exit 1

RDscriptvalgrind ./.ci/install-r-deps.R --test || exit 1
sh build-cran-package.sh \
--r-executable=RDvalgrind \
Expand All @@ -18,7 +21,7 @@ VALGRIND_LOGS_FILE="valgrind-logs.log"
RDvalgrind \
--no-readline \
--vanilla \
-d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" \
-d "valgrind --tool=memcheck --leak-check=full --track-origins=yes --gen-suppressions=all" \
-f testthat.R \
> ${ALL_LOGS_FILE} 2>&1 || exit 1

Expand Down
148 changes: 0 additions & 148 deletions .github/workflows/cpp.yml

This file was deleted.

Loading
Loading