CI #2450
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: CI | |
| # Run on master, tags, or any pull request | |
| on: | |
| pull_request: | |
| branches: "*" | |
| push: | |
| branches: master | |
| tags: "*" | |
| schedule: | |
| - cron: "0 2 * * *" # Daily at 2 AM UTC (8 PM CST) | |
| # Skip/cancel execution of queued/running jobs from outdated commits. Jobs run on the | |
| # `master` branch are not subject to these restrictions and are always executed. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| env: | |
| # The HEAD commit which triggered this workflow. By default PRs use a merge commit | |
| SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| jobs: | |
| version: | |
| name: Resolve Julia Versions | |
| # These permissions are needed to: | |
| # - Checkout the Git repository (`contents: read`) | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| json: ${{ steps.julia-version.outputs.resolved-json }} | |
| steps: | |
| - uses: actions/checkout@v6 # Needed for "min" to access the Project.toml | |
| - uses: julia-actions/julia-version@v0.1.0 | |
| id: julia-version | |
| with: | |
| versions: | | |
| - min # Project's oldest supported version | |
| - lts # Long-Term Stable | |
| - 1 # Latest release | |
| test: | |
| name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | |
| needs: version | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: ${{ matrix.version == 'nightly' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.version.outputs.json) }} | |
| # https://github.com/actions/runner-images#available-images | |
| os: | |
| - ubuntu-latest | |
| - macos-15 # Apple silicon | |
| - windows-latest | |
| arch: | |
| - x64 | |
| - x86 | |
| - aarch64 | |
| exclude: | |
| # Test 32-bit only on Linux | |
| - os: macos-15 | |
| arch: x86 | |
| - os: windows-latest | |
| arch: x86 | |
| # Test ARM64 only on macOS | |
| - os: ubuntu-latest | |
| arch: aarch64 | |
| - os: windows-latest | |
| arch: aarch64 | |
| # Prefer testing against Apple Silicon when possible | |
| - os: macos-15 | |
| arch: x64 | |
| - version: "1.6.0" # min | |
| os: macos-15 | |
| arch: aarch64 | |
| # Disable Windows tests on Julia 1.6 as it's particularly slow | |
| - version: "1.6.0" | |
| os: windows-latest | |
| include: | |
| # Apple silicon isn't supported by Julia 1.6 | |
| - version: "1.6.0" # min | |
| os: macos-15-intel # Will be retired in fall 2027 | |
| arch: x64 | |
| # Test nightly only on Linux 64-bit | |
| - version: nightly | |
| os: ubuntu-latest | |
| arch: x64 | |
| env: | |
| # Only download the tzdata version used in TimeZones.jl's tests to avoid unnecessary | |
| # load on IANA's servers. | |
| JULIA_TZ_VERSION: 2016j # Matches tzdata version used in tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| arch: ${{ matrix.arch }} | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - uses: julia-actions/julia-runtest@v1 | |
| - uses: julia-actions/julia-processcoverage@v1 | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| files: lcov.info | |
| # TODO: Use shared project environments when the minimum version of Julia is 1.8 (e.g. `@sysimage`) | |
| sysimage: | |
| name: System Image - Julia ${{ matrix.version }} - TZJData ${{ matrix.tzjdata-version }} - ${{ matrix.os }} | |
| needs: version | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.version.outputs.json) }} | |
| os: | |
| - ubuntu-latest | |
| tzjdata-version: | |
| - "1.3.0" # Version which does not support `artifact_dir()` (https://github.com/JuliaTime/TimeZones.jl/pull/479) | |
| - "1" | |
| env: | |
| JULIA_DEPOT_PATH: build-depot | |
| TZJDATA_VERSION: ${{ matrix.tzjdata-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| # Caching here slows things down more than it helps | |
| # - uses: julia-actions/cache@v2 | |
| - name: Install PackageCompiler | |
| shell: julia --color=yes {0} | |
| run: | | |
| using Pkg | |
| Pkg.add(PackageSpec(name="PackageCompiler", version="2")) | |
| - name: Create project | |
| shell: julia --color=yes --project=sysimage {0} | |
| run: | | |
| using Pkg | |
| Pkg.add(PackageSpec(name="TZJData", version=ENV["TZJDATA_VERSION"])) | |
| Pkg.add(PackageSpec(name="TimeZones", rev=ENV["SHA"])) | |
| - name: Create system image | |
| shell: julia --color=yes {0} | |
| run: | | |
| using PackageCompiler | |
| create_sysimage(; project="sysimage", sysimage_path="sysimage.so") | |
| # Ensure that TimeZones.jl doesn't require write access to the depot with typical usage (i.e. no tzdata compiling tzdata) | |
| - name: Make depot immutable | |
| run: | | |
| chmod -R ugo-w build-depot | |
| if touch build-depot/write-test 2>/dev/null; then | |
| echo "Supposedly immutable Julia depot still allows write access" >&2 | |
| exit 1 | |
| fi | |
| - name: Validate system image works | |
| shell: julia --color=yes --project=sysimage -Jsysimage.so {0} | |
| run: | | |
| using TimeZones | |
| println(TimeZones._COMPILED_DIR[]) | |
| - name: Relocate Julia depot | |
| run: | | |
| mv build-depot sysimage-depot | |
| - name: Validate system image works with relocated depot | |
| shell: julia --color=yes --project=sysimage -Jsysimage.so {0} | |
| run: | | |
| using TimeZones | |
| println(TimeZones._COMPILED_DIR[]) | |
| env: | |
| JULIA_DEPOT_PATH: sysimage-depot | |
| # https://pkgdocs.julialang.org/v1/creating-packages/#Transition-from-normal-dependency-to-extension | |
| weakdeps: | |
| name: Weakdeps | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "lts" # Long-Term Stable | |
| - uses: julia-actions/cache@v2 | |
| - shell: julia --color=yes --project=weakdeps {0} | |
| run: | | |
| using Pkg | |
| Pkg.add(PackageSpec(name="TimeZones", rev=ENV["SHA"])) | |
| using TimeZones | |
| # See: https://github.com/JuliaTime/TimeZones.jl/pull/485 | |
| force-latest-compatible: | |
| name: Force Latest Compatible - Julia ${{ matrix.version }} - ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - "1.7" | |
| os: | |
| - windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| - uses: julia-actions/cache@v2 | |
| - name: Test | |
| shell: julia --color=yes --project {0} | |
| run: | | |
| using Pkg | |
| Pkg.test(; allow_reresolve=true, force_latest_compatible_version=true) | |
| benchmarks: | |
| name: Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "1.11" # TODO: Updates to "1" | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - run: | | |
| git fetch origin +:refs/remotes/origin/HEAD | |
| julia --project=benchmark/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))' | |
| julia --project=benchmark/ -e 'using PkgBenchmark, TimeZones; export_markdown(stdout, judge(TimeZones, "origin/HEAD", verbose=false))' | |
| doctest: | |
| name: Documentation - DocTests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "lts" | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - shell: julia --color=yes --project=docs {0} | |
| run: | | |
| using Pkg | |
| Pkg.instantiate() | |
| - run: julia --color=yes --project=docs docs/make.jl | |
| env: | |
| DOCTESTS: "true" | |
| docs: | |
| name: Documentation - Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: "lts" | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - shell: julia --color=yes --project=docs {0} | |
| run: | | |
| using Pkg | |
| Pkg.instantiate() | |
| - run: julia --color=yes --project=docs docs/make.jl | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | |
| DEPLOY_DOCS: "true" |