diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d60f0707..7c1e3b97 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,10 @@ -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" - directory: "/" # Location of package manifests + directory: "/" schedule: interval: "monthly" + open-pull-requests-limit: 100 + labels: + - "dependencies" + - "github-actions" diff --git a/.github/workflows/MyLib.yml b/.github/workflows/MyLib.yml deleted file mode 100644 index d012f65b..00000000 --- a/.github/workflows/MyLib.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build MyLib -on: - pull_request: - branches: - - 'master' - - 'release-*' - push: - branches: - - 'master' - - 'release-*' - tags: '*' -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: '1' - - uses: julia-actions/julia-buildpkg@v1 - with: - project: 'examples/MyLib' - - uses: julia-actions/julia-buildpkg@v1 - with: - project: 'examples/MyLib/build' - - run: | - cd examples/MyLib - make - - run: ./examples/MyLib/my_application.out - env: - LD_LIBRARY_PATH: 'examples/MyLib/MyLibCompiled/lib' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d5fff17..154a8989 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,40 @@ name: CI + on: pull_request: - branches: - - 'master' - - 'release-*' push: branches: - 'master' - 'release-*' tags: '*' + concurrency: - group: ${{ github.head_ref || github.ref_name || github.run_id }} - cancel-in-progress: true + # Skip intermediate builds: all builds except for builds on the `master` branch + # Cancel intermediate builds: only pull request builds + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: + finalize-pr-checks: + if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: + - ci_started + - test + - docs + - build-mylib + steps: + - run: | + echo ci_started: ${{ needs.ci_started.result }} + echo test: ${{ needs.test.result }} + echo docs: ${{ needs.docs.result }} + echo build-mylib: ${{ needs.build-mylib.result }} + - run: exit 1 + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} ci_started: - timeout-minutes: 3 runs-on: ubuntu-latest + timeout-minutes: 10 steps: - run: exit 0 test: @@ -26,23 +45,32 @@ jobs: fail-fast: false matrix: julia-version: - - '1.6' - - '1.9' - - '1.10' - - 'nightly' + - '1.6' # previous LTS + - '1.9' # TODO: comment out this line once I am finished debugging. + - '1.10' # current LTS + # - '1.11' # TODO: uncomment this line once we fix the tests on 1.11 + # - 'nightly' # TODO: decide whether we want to run any CI jobs on nightly. julia-arch: - - 'x64' - - 'x86' + - 'x64' # 32-bit Julia + - 'x86' # 64-bit Julia os: - ubuntu-latest - - macOS-latest - windows-latest + # - macos-13 # macos-13 = Intel. # TODO: uncomment this line once we merge #930 + # TODO: uncomment the next line, so that we can start testing on macos-14: + # - macos-14 # macos-14 = Apple Silicon. coverage: - 'true' - - 'false' # needed for 1.9+ to test from a session using pkgimages + - 'false' # needed for Julia 1.9+ to test from a session using pkgimages exclude: - - os: macOS-latest + # For now, we'll disable testing 32-bit Julia on Windows. + # TODO: remove the following once we fix the tests for 32-bit Julia on Windows. + - os: windows-latest + julia-arch: x86 + # We don't have 32-bit builds of Julia for macOS: + - os: macos-latest julia-arch: x86 + # We don't need to run the coverage=false job for Julia < 1.9: - julia-version: '1.6' coverage: 'false' - julia-version: '1.7' @@ -50,16 +78,16 @@ jobs: - julia-version: '1.8' coverage: 'false' steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 with: version: ${{ matrix.julia-version }} - - uses: julia-actions/cache@v2 - - uses: julia-actions/julia-runtest@latest + - uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5 + - uses: julia-actions/julia-runtest@d0c4f093badade621cd041bba567d1e832480ac2 # v1.10.0 with: coverage: ${{ matrix.coverage }} - - uses: julia-actions/julia-processcoverage@latest - - uses: codecov/codecov-action@v4 + - uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38 # v1.2.2 + - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 with: file: lcov.info env: @@ -68,8 +96,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 with: version: '1' - name: Build and deploy docs @@ -77,3 +105,22 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); include("docs/make.jl")' + build-mylib: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 + with: + version: '1' + - uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c # v1.6.0 + with: + project: 'examples/MyLib' + - uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c # v1.6.0 + with: + project: 'examples/MyLib/build' + - run: | + cd examples/MyLib + make + - run: ./examples/MyLib/my_application.out + env: + LD_LIBRARY_PATH: 'examples/MyLib/MyLibCompiled/lib' \ No newline at end of file diff --git a/examples/MyApp/Artifacts.toml b/examples/MyApp/Artifacts.toml index 58a1d07b..b6ba775b 100644 --- a/examples/MyApp/Artifacts.toml +++ b/examples/MyApp/Artifacts.toml @@ -1,46 +1,143 @@ -[[fooifier]] -arch = "x86_64" -git-tree-sha1 = "98d93024ca384050c59d554415b75d61e467fd8c" +[[HelloWorldC]] +arch = "aarch64" +git-tree-sha1 = "d4036700fbbf29b31f5d1d5d948547edd3b70e11" +os = "macos" + + [[HelloWorldC.download]] + sha256 = "1fd55f038a73c89f4e22b437a9182421e0d31c50bd4912c719215f6a736d50f1" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.aarch64-apple-darwin.tar.gz" +[[HelloWorldC]] +arch = "aarch64" +git-tree-sha1 = "c82465bd6d0aa1369ff2fd961b73884d1f5de49a" +libc = "glibc" +os = "linux" + + [[HelloWorldC.download]] + sha256 = "5bfa84332c7ee485ca8e2eee216ad9fa77b2c43d5f261baa823e301b7c789ec4" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.aarch64-linux-gnu.tar.gz" +[[HelloWorldC]] +arch = "aarch64" +git-tree-sha1 = "cb4b8c88778c6cd93b6df38ec5b95a2678434f5d" +libc = "musl" +os = "linux" + + [[HelloWorldC.download]] + sha256 = "924df1c2a386f79a2727a2f989393102649a24863214f2e88cb4a677d3d22e14" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.aarch64-linux-musl.tar.gz" +[[HelloWorldC]] +arch = "armv6l" +call_abi = "eabihf" +git-tree-sha1 = "20a32b71145b67e708f63fb5880a7243727aec0f" libc = "glibc" os = "linux" - [[fooifier.download]] - sha256 = "5208c63a9d07e592c78f541fc13caa8cd191b11e7e77b31d407237c2b13ec391" - url = "https://github.com/staticfloat/small_bin/raw/master/libfoo/libfoo.x86_64-linux-gnu.tar.gz" + [[HelloWorldC.download]] + sha256 = "6f0997b0aad387ba6e2402530642bb4ded85b0243460d2e4b13d94f2c8340a44" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.armv6l-linux-gnueabihf.tar.gz" +[[HelloWorldC]] +arch = "armv6l" +call_abi = "eabihf" +git-tree-sha1 = "c1179604ea37fa66ee6d5d592c7bbfd1f20292c3" +libc = "musl" +os = "linux" -[[fooifier]] + [[HelloWorldC.download]] + sha256 = "0aca47bce6f09c38a7939277a593deb988123fe59f7992225a1ede8e174f1b06" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.armv6l-linux-musleabihf.tar.gz" +[[HelloWorldC]] +arch = "armv7l" +call_abi = "eabihf" +git-tree-sha1 = "0a8e7b523ef6be31311aefe9983a488616e58201" +libc = "glibc" +os = "linux" + + [[HelloWorldC.download]] + sha256 = "f29f4da556d2b4ee9eaff7740aa0f9436406b75b0f1ec428e881a47ab7b7477b" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.armv7l-linux-gnueabihf.tar.gz" +[[HelloWorldC]] +arch = "armv7l" +call_abi = "eabihf" +git-tree-sha1 = "ca94b4d87f1a276066a2994733142e35046c41dd" +libc = "musl" +os = "linux" + + [[HelloWorldC.download]] + sha256 = "5fb4019d6d797e5e3860cfec90cab12f6865fa624e87b51c20220a44bb94846a" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.armv7l-linux-musleabihf.tar.gz" +[[HelloWorldC]] arch = "i686" -git-tree-sha1 = "c3a9f27382862092e064bcf4aeb3cb7190578338" +git-tree-sha1 = "cb1aefe048a6c0395b6b664695c20cb50dbec8e3" libc = "glibc" os = "linux" - [[fooifier.download]] - sha256 = "97655b6a218d61284723b6923d7c96e6a256fa68b9419d723c588aa24404b102" - url = "https://github.com/staticfloat/small_bin/raw/master/libfoo/libfoo.i686-linux-gnu.tar.gz" + [[HelloWorldC.download]] + sha256 = "c79def491d702590b9c82599d40c4e755251dbb49669d0290f9a1a7bf1d91a1a" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.i686-linux-gnu.tar.gz" +[[HelloWorldC]] +arch = "i686" +git-tree-sha1 = "b50220be02e9c839749f91a70694ae68c2712c8e" +libc = "musl" +os = "linux" -[[fooifier]] + [[HelloWorldC.download]] + sha256 = "6aecc06cf803ad16703744610deb243a21b39e19ae1951a38977610881698f9e" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.i686-linux-musl.tar.gz" +[[HelloWorldC]] +arch = "i686" +git-tree-sha1 = "0f7597f042d16d438f9684e20ca57ea22e4e15c1" +os = "windows" + + [[HelloWorldC.download]] + sha256 = "5f14f5ade1314e777432bd85cd075ae9d31e28352e646f90adf0444a7a54f76b" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.i686-w64-mingw32.tar.gz" +[[HelloWorldC]] +arch = "powerpc64le" +git-tree-sha1 = "5e9c87fc4e3372c27a77061a49d97fa5002df0e4" +libc = "glibc" +os = "linux" + + [[HelloWorldC.download]] + sha256 = "e2a728b29124fc7408d6e47cc6fc943d0336d1386e56a3775a0665b34528881b" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.powerpc64le-linux-gnu.tar.gz" +[[HelloWorldC]] arch = "x86_64" -git-tree-sha1 = "f413ff2438a4e9e9dd69b23c35ca30de6af069cc" +git-tree-sha1 = "09ed293f6f5ebfcaf90eef2b4d45c402d834d33e" os = "macos" - [[fooifier.download]] - sha256 = "fcc268772d6f21d65b45fcf3854a3142679b78e53c7673dac26c95d6ccc89a24" - url = "https://github.com/staticfloat/small_bin/raw/master/libfoo/libfoo.x86_64-apple-darwin14.tar.gz" + [[HelloWorldC.download]] + sha256 = "9feabdcb8341d37d0c8b1acb5840e1c9d524632c5aff40c05b5e0e1d621a7e30" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.x86_64-apple-darwin.tar.gz" +[[HelloWorldC]] +arch = "x86_64" +git-tree-sha1 = "8c8251b0c21615bce0701995eded26ac7697b5cc" +libc = "glibc" +os = "linux" -[[fooifier]] + [[HelloWorldC.download]] + sha256 = "974f7e1d1cdbebad149e51fed4f1b7c6a0b5ccfa350f7d252dfcf66c2dbf9f63" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.x86_64-linux-gnu.tar.gz" +[[HelloWorldC]] arch = "x86_64" -git-tree-sha1 = "1351b831192db9091d97e9b4bc84231ade05d210" -os = "windows" +git-tree-sha1 = "cfaaf0517421585561e3b30dd6f53f6c14b2835f" +libc = "musl" +os = "linux" - [[fooifier.download]] - sha256 = "7f8939e9529835b83810d3ae7e2556f6e002d571f619894e54ece42ea5262b7f" - url = "https://github.com/staticfloat/small_bin/raw/master/libfoo/libfoo.x86_64-w64-mingw32.tar.gz" + [[HelloWorldC.download]] + sha256 = "25d3d6ecc753f4dbbcaab0db7b6c20b29b0a79b0c31f7a26a0cf18c365d27809" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.x86_64-linux-musl.tar.gz" +[[HelloWorldC]] +arch = "x86_64" +git-tree-sha1 = "9adaeee1375ffd66613afe71f111dad3a88fb302" +os = "freebsd" -[[fooifier]] -arch = "aarch64" -git-tree-sha1 = "281cbe3dd65aa4bdb887bfb29651da500c81e242" -os = "linux" + [[HelloWorldC.download]] + sha256 = "8e59a00a9238d1605af09ec3a76c8bb5ad012b5621f5ccb7de6cf73f89fbf18f" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.x86_64-unknown-freebsd.tar.gz" +[[HelloWorldC]] +arch = "x86_64" +git-tree-sha1 = "59955b315ce95abd82f71d29389be3b734b14821" +os = "windows" - [[fooifier.download]] - sha256 = "36886ac25cf5678c01fe20630b413f9354b7a3721c6a2c2043162f7ebd147ff5" - url = "https://github.com/staticfloat/small_bin/raw/master/libfoo/libfoo.aarch64-linux-gnu.tar.gz" + [[HelloWorldC.download]] + sha256 = "47bbead5cbdfca1b23544b1b398e8a2194c78ab8a772ca3075084c4a9ab75fb7" + url = "https://github.com/JuliaBinaryWrappers/HelloWorldC_jll.jl/releases/download/HelloWorldC-v1.3.0+0/HelloWorldC.v1.3.0.x86_64-w64-mingw32.tar.gz" \ No newline at end of file diff --git a/examples/MyApp/src/MyApp.jl b/examples/MyApp/src/MyApp.jl index 61e9162c..8a146c60 100644 --- a/examples/MyApp/src/MyApp.jl +++ b/examples/MyApp/src/MyApp.jl @@ -18,7 +18,7 @@ const outputo = begin o == C_NULL ? "ok" : unsafe_string(o) end -fooifier_path() = joinpath(artifact"fooifier", "bin", "fooifier" * (Sys.iswindows() ? ".exe" : "")) +hello_world_path() = joinpath(artifact"HelloWorldC", "bin", "hello_world" * (Sys.iswindows() ? ".exe" : "")) function julia_main()::Cint try @@ -61,8 +61,8 @@ function real_main() @show is_crayons_loaded() println("Running the artifact") - res = read(`$(fooifier_path()) 5 10`, String) - println("The result of 2*5^2 - 10 == $res") + res = readchomp(`$(hello_world_path())`) + println("Artifact printed: $res") @show unsafe_string(Base.JLOptions().image_file) @show Example.domath(5) diff --git a/test/runtests.jl b/test/runtests.jl index c7dc88a3..00572238 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -82,7 +82,7 @@ end tmp_app_source_dir = joinpath(tmp, "MyApp") cp(app_source_dir, tmp_app_source_dir) if is_julia_1_6 - # Issue #706 "Cannot locate artifact 'LLVMExtra'" on 1.6 so remove + # Issue #706 "Cannot locate artifact 'LLVMExtra'" on 1.6 so remove remove_llvmextras(joinpath(tmp_app_source_dir, "Project.toml")) end try @@ -117,7 +117,7 @@ end # Check jll package runs @test occursin("Hello, World!", app_output) # Check artifact runs - @test occursin("The result of 2*5^2 - 10 == 40.000000", app_output) + @test occursin("Artifact printed: Hello, World!", app_output) # Check artifact gets run from the correct place @test occursin("HelloWorld artifact at $(realpath(app_compiled_dir))", app_output) # Check ARGS