Skip to content

Add compilation trace to CI #451

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,20 @@ jobs:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: Create Julia wrapper that traces compilation
run: |
mkdir -p ${{ github.workspace }}/julia-wrapper
echo '#!/bin/bash' > ${{ github.workspace }}/julia-wrapper/julia
echo 'exec $(which julia) --trace-compile=$TRACE_COMPILE_PATH "$@"' >> ${{ github.workspace }}/julia-wrapper/julia
chmod +x ${{ github.workspace }}/julia-wrapper/julia
echo "${{ github.workspace }}/julia-wrapper" >> $GITHUB_PATH
- uses: julia-actions/julia-runtest@v1
with:
annotate: true
env:
USE_DEV: "false"
LOG_USING_RXINFER: "false"
TRACE_COMPILE_PATH: ${{ github.workspace }}/server-compilation-trace.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
Expand All @@ -81,6 +91,13 @@ jobs:
with:
name: test-output-${{ matrix.version }}-${{ matrix.os }}-${{ matrix.arch }}
path: test/_output
retention-days: 30
- name: Archive compilation trace
uses: actions/upload-artifact@v4
with:
name: server-compilation-trace-${{ matrix.version }}-${{ matrix.os }}-${{ matrix.arch }}.jl
path: server-compilation-trace.jl
retention-days: 30
test-examples:
name: Examples
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ makedocs(;
"Rule Not Found Error" => "manuals/sharpbits/rule-not-found.md",
"Stack Overflow in Message Computations" => "manuals/sharpbits/stack-overflow-inference.md",
"Using `=` instead of `:=` for deterministic nodes" => "manuals/sharpbits/usage-colon-equality.md"
]
],
],
"Library" => [
"Model construction" => "library/model-construction.md",
Expand All @@ -71,7 +71,8 @@ makedocs(;
"Contribution guidelines" => "contributing/guidelines.md",
"Contributing to the documentation" => "contributing/new-documentation.md",
"Contributing to the examples" => "contributing/new-example.md",
"Publishing a new release" => "contributing/new-release.md"
"Publishing a new release" => "contributing/new-release.md",
"Developer Notes" => "contributing/developer-notes.md"
]
]
)
Expand Down
26 changes: 26 additions & 0 deletions docs/src/contributing/developer-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Developer Notes

## Precompiled Traces

The CI workflow automatically generates compilation traces during test runs. These traces contain information about which functions are compiled during the test suite execution and can be useful for optimizing package loading time and first-time run latency.

The traces are saved as artifacts in GitHub Actions and are retained for 30 days. You can download these artifacts from the workflow run page to analyze package compilation patterns or use them for precompilation.

To access the traces:
1. Go to the GitHub Actions page for the repository
2. Select a completed workflow run
3. Scroll down to the Artifacts section
4. Download the `server-compilation-trace-*.jl` file

These traces can be used in combination with `PackageCompiler.jl`. See the documentation for PackageCompiler for more details.

## Test Output Artifacts

The CI workflow also saves test output artifacts that contain the results of test runs. These artifacts include generated plots, logs, and other outputs produced during test execution.

Like the compilation traces, test output artifacts are retained for 30 days and can be accessed from the GitHub Actions workflow run page. They are named `test-output-<version>-<os>-<arch>` and can be helpful for debugging test failures or examining test behavior across different Julia versions and operating systems.

To use these artifacts:
1. Navigate to the GitHub Actions workflow run
2. Download the test output artifacts
3. Extract the contents to examine the test-generated files
14 changes: 0 additions & 14 deletions docs/src/contributing/examples.md

This file was deleted.

Loading