diff --git a/.github/workflows/version_check.yml b/.github/workflows/version_check.yml index caebdffd6..764ac60fa 100644 --- a/.github/workflows/version_check.yml +++ b/.github/workflows/version_check.yml @@ -41,6 +41,7 @@ jobs: - name: Check version consistency shell: julia --color=yes --project=. {0} + continue-on-error: true run: | using Pkg Pkg.activate(temp=true) @@ -117,6 +118,8 @@ jobs: manifest_version = VersionNumber(manifest_toml["deps"]["Turing"][1]["version"]) println("Manifest.toml version: ", manifest_version) + errors = [] + if ENV["TARGET_IS_MASTER"] == "true" # Fetch the latest version from GitHub and update files to match this version # if necessary. @@ -126,16 +129,20 @@ jobs: println("Latest Turing.jl version: ", latest_version) if !major_minor_match(latest_version, project_version) + push!(errors, "$(PROJECT_TOML_PATH) out of date") println("$(PROJECT_TOML_PATH) is out of date; updating") update_project_toml(PROJECT_TOML_PATH, latest_version) end if !major_minor_match(latest_version, quarto_version) + push!(errors, "$(QUARTO_YML_PATH) out of date") + n_errors += 1 println("$(QUARTO_YML_PATH) is out of date; updating") update_quarto_yml(QUARTO_YML_PATH, latest_version) end if !major_minor_patch_match(latest_version, manifest_version) + push!(errors, "$(MANIFEST_TOML_PATH) out of date") # Attempt to automatically update Manifest println("$(MANIFEST_TOML_PATH) is out of date; updating") old_env = Pkg.project().path @@ -146,10 +153,14 @@ jobs: manifest_toml = TOML.parsefile(MANIFEST_TOML_PATH) manifest_version = VersionNumber(manifest_toml["deps"]["Turing"][1]["version"]) if !major_minor_patch_match(latest_version, manifest_version) - error("Failed to update Manifest.toml to match latest Turing.jl version") + push!(errors, "Failed to update $(MANIFEST_TOML_PATH) to match latest Turing.jl version") end end + if !isempty(errors) + error("The following errors occurred during version checking: \n", join(errors, "\n")) + end + else # Don't attempt to fetch the latest version; just check for consistency # and error if versions don't match. @@ -174,7 +185,7 @@ jobs: title: "Update Turing.jl version to match latest release" - name: Comment on PR about suggested changes - if: ${{ github.event_name == 'pull_request' }} && ${{ steps.create_pr.outputs.pull-request-operation == 'created' }} + if: ${{ github.event_name == 'pull_request' && steps.create_pr.outputs.pull-request-operation == 'created' }} uses: thollander/actions-comment-pull-request@v2 with: message: |