Skip to content

Initial PR-based artifact update workflow #54

Initial PR-based artifact update workflow

Initial PR-based artifact update workflow #54

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
tags: ["*"]
concurrency:
# Skip intermediate builds: on all builds except on the "main" branch.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.run_number || 0 }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
prerelease:
runs-on: ubuntu-latest
outputs:
key: ${{ steps.key.outputs.key }}
tarball_filename: ${{ steps.key.outputs.tarball_filename }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
modified_artifacts_toml:
- Artifacts.toml
- uses: actions/checkout@v4
if: ${{ steps.filter.outputs.modified_artifacts_toml == 'true' }}
- name: Check for unpublished artifact
if: ${{ steps.filter.outputs.modified_artifacts_toml == 'true' }}
id: key
shell: julia --color=yes {0}
run: |
include(joinpath(pwd(), "gen", "artifacts.jl"))
(; key, tarball_filename) = gh_artifact()
open(ENV["GITHUB_OUTPUT"], "a") do io
println(io, "key=$key")
println(io, "tarball_filename=$tarball_filename")
end
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
needs: prerelease
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- "1.6" # LTS / Oldest supported version
- "1" # Latest release
- "nightly"
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: dawidd6/action-download-artifact@v3
if: ${{ needs.prerelease.outputs.key }}
id: action-artifact
with:
workflow: Build.yaml
name: ${{ needs.prerelease.outputs.key }}
- run: |
mkdir prerelease
tar xvf ${{ needs.prerelease.outputs.tarball_filename }} -C prerelease
ls -la
- shell: julia --color=yes {0}
run: |
artifacts_overrides_toml = joinpath(first(Base.DEPOT_PATH), "artifacts", "Overrides.toml")
mkpath(dirname(artifacts_overrides_toml))
open(artifacts_overrides_toml, "w") do io
println(
io,
"""
[dc5dba14-91b3-4cab-a142-028a31da12f7]
tzjdata = "$(pwd())/prerelease"
"""
)
end
# Work around Pkg.jl issue #2662
open("Artifacts.toml", "w") do io
println(
io,
"""
[tzjdata]
git-tree-sha1 = "b071cffdb310f5d3ca640c09cfa3dc3f23d450ad"
"""
)
end
- run: |
set -x
cat ~/.julia/artifacts/Overrides.toml
cat Artifacts.toml
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1