mirror of
https://github.com/julia-actions/julia-runtest.git
synced 2026-02-17 21:46:55 +08:00
Compare commits
13 Commits
v1.11.2
...
ib/info_on
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
198ed292c4 | ||
|
|
65a5f81584 | ||
|
|
013f11f99f | ||
|
|
f098dd2fa4 | ||
|
|
b67f25cc97 | ||
|
|
a3f37496e4 | ||
|
|
bb32a7cb3f | ||
|
|
f30bb67fa4 | ||
|
|
bf008bfadc | ||
|
|
af712fe095 | ||
|
|
8cf619ee45 | ||
|
|
991e65d3c2 | ||
|
|
9ed3aa0601 |
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
@@ -7,17 +7,24 @@ on:
|
|||||||
- "master"
|
- "master"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 5
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- "1.0"
|
- "1.0"
|
||||||
|
- "lts"
|
||||||
- "1" # automatically expands to the latest stable 1.x release of Julia
|
- "1" # automatically expands to the latest stable 1.x release of Julia
|
||||||
- nightly
|
- "pre"
|
||||||
|
- "nightly"
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macOS-latest
|
- macOS-latest
|
||||||
@@ -25,14 +32,26 @@ jobs:
|
|||||||
arch:
|
arch:
|
||||||
- x64
|
- x64
|
||||||
- x86
|
- x86
|
||||||
|
- aarch64
|
||||||
# 32-bit Julia binaries are not available on macOS
|
# 32-bit Julia binaries are not available on macOS
|
||||||
|
# macOS runners use Apple Silicon (ARM64)
|
||||||
exclude:
|
exclude:
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
arch: x86
|
arch: x86
|
||||||
|
- os: macOS-latest
|
||||||
|
arch: x64
|
||||||
|
- os: ubuntu-latest
|
||||||
|
arch: aarch64
|
||||||
|
- os: windows-latest
|
||||||
|
arch: aarch64
|
||||||
|
# Julia 1.0 didn't support ARM64
|
||||||
|
- os: macOS-latest
|
||||||
|
arch: aarch64
|
||||||
|
version: "1.0"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Example.jl
|
- name: Checkout Example.jl
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
with:
|
with:
|
||||||
repository: julia-actions/Example.jl
|
repository: julia-actions/Example.jl
|
||||||
|
|
||||||
@@ -41,7 +60,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Checkout julia-runtest
|
- name: Checkout julia-runtest
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
with:
|
with:
|
||||||
path: ./.github/actions/julia-runtest
|
path: ./.github/actions/julia-runtest
|
||||||
|
|
||||||
@@ -50,29 +69,20 @@ jobs:
|
|||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
- uses: julia-actions/cache@d10a6fd8f31b12404a54613ebad242900567f2b9 # v2.1.0
|
||||||
env:
|
|
||||||
cache-name: cache-artifacts
|
|
||||||
with:
|
|
||||||
path: ~/.julia/artifacts
|
|
||||||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-test-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-test-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- uses: julia-actions/julia-buildpkg@e3eb439fad4f9aba7da2667e7510e4a46ebc46e1 # v1.7.0
|
# - uses: julia-actions/julia-buildpkg@e3eb439fad4f9aba7da2667e7510e4a46ebc46e1 # v1.7.0
|
||||||
|
|
||||||
- uses: ./.github/actions/julia-runtest
|
- uses: ./.github/actions/julia-runtest
|
||||||
|
|
||||||
- uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38
|
- uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38
|
||||||
|
|
||||||
- uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
|
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|
||||||
with:
|
with:
|
||||||
files: lcov.info
|
files: lcov.info
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
fail-ci-if-error: true
|
fail-ci-if-error: true
|
||||||
|
|
||||||
|
|
||||||
- name: Verify that test output file exists
|
- name: Verify that test output file exists
|
||||||
run: test -f "$HOME/julia-runtest"
|
run: test -f "$HOME/julia-runtest"
|
||||||
|
|||||||
34
.github/workflows/test_logger_ci.yml
vendored
34
.github/workflows/test_logger_ci.yml
vendored
@@ -7,17 +7,24 @@ on:
|
|||||||
- "master"
|
- "master"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 5
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- "1.6"
|
- "1.6"
|
||||||
|
- "lts"
|
||||||
- "1" # automatically expands to the latest stable 1.x release of Julia
|
- "1" # automatically expands to the latest stable 1.x release of Julia
|
||||||
- nightly
|
- "pre"
|
||||||
|
- "nightly"
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macOS-latest
|
- macOS-latest
|
||||||
@@ -25,29 +32,32 @@ jobs:
|
|||||||
arch:
|
arch:
|
||||||
- x64
|
- x64
|
||||||
- x86
|
- x86
|
||||||
|
- aarch64
|
||||||
# 32-bit Julia binaries are not available on macOS
|
# 32-bit Julia binaries are not available on macOS
|
||||||
|
# macOS runners use Apple Silicon (ARM64)
|
||||||
exclude:
|
exclude:
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
arch: x86
|
arch: x86
|
||||||
|
- os: macOS-latest
|
||||||
|
arch: x64
|
||||||
|
- os: ubuntu-latest
|
||||||
|
arch: aarch64
|
||||||
|
- os: windows-latest
|
||||||
|
arch: aarch64
|
||||||
|
# Julia 1.6 didn't support ARM64
|
||||||
|
- os: macOS-latest
|
||||||
|
arch: aarch64
|
||||||
|
version: "1.6"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout julia-runtest
|
- name: Checkout julia-runtest
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
|
||||||
- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2.6.1
|
- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2.6.1
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
- uses: julia-actions/cache@d10a6fd8f31b12404a54613ebad242900567f2b9 # v2.1.0
|
||||||
env:
|
|
||||||
cache-name: cache-artifacts
|
|
||||||
with:
|
|
||||||
path: ~/.julia/artifacts
|
|
||||||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-test-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-test-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- run: julia --color=yes --check-bounds=yes test_logger_tests.jl
|
- run: julia --color=yes --check-bounds=yes test_logger_tests.jl
|
||||||
|
|||||||
34
action.yml
34
action.yml
@@ -66,9 +66,39 @@ runs:
|
|||||||
prefix=( ${{ inputs.prefix }} )
|
prefix=( ${{ inputs.prefix }} )
|
||||||
[[ -n ${prefix[*]} ]] && julia_cmd=( "${prefix[@]}" "${julia_cmd[@]}" )
|
[[ -n ${prefix[*]} ]] && julia_cmd=( "${prefix[@]}" "${julia_cmd[@]}" )
|
||||||
|
|
||||||
# Run the Julia command
|
# Determine which signal to use for diagnostics based on OS
|
||||||
|
if [[ "$(uname -s)" == "Darwin" ]] || [[ "$(uname -s)" == *"BSD"* ]]; then
|
||||||
|
info_signal="INFO"
|
||||||
|
else
|
||||||
|
info_signal="USR1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set up signal handler to send diagnostic signal when we receive SIGTERM
|
||||||
|
# (which GitHub Actions sends on timeout/cancellation)
|
||||||
|
trap_handler() {
|
||||||
|
echo "::warning::Timeout/cancellation detected - sending SIG${info_signal} to Julia process for diagnostic output"
|
||||||
|
if kill -0 "$julia_pid" 2>/dev/null; then
|
||||||
|
kill -s "$info_signal" "$julia_pid" 2>/dev/null || true
|
||||||
|
# Give Julia a moment to print diagnostics before we get killed
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
# Re-send SIGTERM to Julia to ensure it terminates
|
||||||
|
kill -TERM "$julia_pid" 2>/dev/null || true
|
||||||
|
wait "$julia_pid" 2>/dev/null || true
|
||||||
|
exit 124 # Standard timeout exit code
|
||||||
|
}
|
||||||
|
trap trap_handler SIGTERM SIGINT
|
||||||
|
|
||||||
|
# Run the Julia command in the background so we can handle signals
|
||||||
echo "::debug::Executing Julia: ${julia_cmd[*]}"
|
echo "::debug::Executing Julia: ${julia_cmd[*]}"
|
||||||
"${julia_cmd[@]}"
|
"${julia_cmd[@]}" &
|
||||||
|
julia_pid=$!
|
||||||
|
|
||||||
|
# Wait for Julia to complete
|
||||||
|
wait "$julia_pid"
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
exit $exit_code
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
ANNOTATE: ${{ inputs.annotate }}
|
ANNOTATE: ${{ inputs.annotate }}
|
||||||
|
|||||||
@@ -14,6 +14,34 @@ kwargs = Kwargs.kwargs(; coverage=ENV["COVERAGE"],
|
|||||||
kwargs_reprs = map(kv -> string(kv[1], "=", repr(kv[2])), collect(kwargs))
|
kwargs_reprs = map(kv -> string(kv[1], "=", repr(kv[2])), collect(kwargs))
|
||||||
kwargs_repr = join(kwargs_reprs, ", ")
|
kwargs_repr = join(kwargs_reprs, ", ")
|
||||||
|
|
||||||
|
# Warn if running on a merge commit (different from branch HEAD)
|
||||||
|
git_note = ""
|
||||||
|
if haskey(ENV, "GITHUB_SHA") && get(ENV, "GITHUB_EVENT_NAME", "") == "pull_request" && haskey(ENV, "GITHUB_HEAD_REF")
|
||||||
|
# For pull_request events, GITHUB_SHA is the merge commit, not the PR head commit
|
||||||
|
try
|
||||||
|
merge_commit = ENV["GITHUB_SHA"]
|
||||||
|
pr_branch = ENV["GITHUB_HEAD_REF"]
|
||||||
|
base_branch_name = get(ENV, "GITHUB_BASE_REF", "")
|
||||||
|
|
||||||
|
# Check if there's any difference between the merge commit and the PR head
|
||||||
|
# In GitHub Actions, HEAD^2 is the PR head (second parent of merge commit)
|
||||||
|
# success() returns true if the command exits with 0 (no differences)
|
||||||
|
has_diff = !success(`git diff --quiet --exit-code HEAD^2 HEAD`)
|
||||||
|
|
||||||
|
if has_diff
|
||||||
|
base_branch = isempty(base_branch_name) ? "the base branch" : "'$base_branch_name'"
|
||||||
|
global git_note = """
|
||||||
|
│ Note: This is being run on merge commit $merge_commit (merge of PR branch '$pr_branch' into $base_branch).
|
||||||
|
│ The content differs from the actual commit on your PR branch.
|
||||||
|
│ To reproduce locally, update your branch with $base_branch first.
|
||||||
|
│
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
catch e
|
||||||
|
@warn "Error while checking git diff" exception=(e, catch_backtrace())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
│
|
│
|
||||||
│ To reproduce this CI run locally run the following from the same repository state on julia version $VERSION:
|
│ To reproduce this CI run locally run the following from the same repository state on julia version $VERSION:
|
||||||
@@ -21,6 +49,7 @@ print("""
|
|||||||
│ `import Pkg; Pkg.test(;$kwargs_repr)`
|
│ `import Pkg; Pkg.test(;$kwargs_repr)`
|
||||||
│
|
│
|
||||||
""")
|
""")
|
||||||
|
print(git_note)
|
||||||
|
|
||||||
if parse(Bool, ENV["ANNOTATE"]) && v"1.8pre" < VERSION < v"1.9.0-beta3"
|
if parse(Bool, ENV["ANNOTATE"]) && v"1.8pre" < VERSION < v"1.9.0-beta3"
|
||||||
push!(LOAD_PATH, "@tests-logger-env") # access dependencies
|
push!(LOAD_PATH, "@tests-logger-env") # access dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user