From 0c4130534d4592993bb2be37df004499be6f3e7e Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 21 Jul 2024 11:11:51 -0400 Subject: [PATCH] Improve example version instructions. Add info about "lts" if user specifies 1.6 explicitly (#265) * improve example versions and note * add info if user explicitly sets version to 1.6 * npm run build * add 1.6 explicitly to CI * convert to a github actions notice * try core.notice * npm run build * Apply suggestions from code review Co-authored-by: Dilum Aluthge * Update action.yml * update example * update toc * npm build --------- Co-authored-by: Dilum Aluthge --- .github/workflows/example-builds.yml | 3 ++- README.md | 32 +++++++++++++++++----------- action.yml | 2 +- lib/setup-julia.js | 3 +++ src/setup-julia.ts | 3 +++ 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/example-builds.yml b/.github/workflows/example-builds.yml index df47aa1..62caf58 100644 --- a/.github/workflows/example-builds.yml +++ b/.github/workflows/example-builds.yml @@ -19,7 +19,8 @@ jobs: strategy: fail-fast: false matrix: - julia-version: ['1.0.5', '1.2', '^1.5.0-beta1', '1', 'lts', 'pre'] + # include '1.6' here to test info message about lts tag existing + julia-version: ['1.0.5', '1.2', '^1.5.0-beta1', '1', '1.6', 'lts', 'pre'] julia-arch: [x64, x86] os: [ubuntu-latest, macOS-latest, windows-latest] # 32-bit Julia binaries are not available on macOS diff --git a/README.md b/README.md index c5c78c8..a2a7321 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,25 @@ This action sets up a Julia environment for use in actions by downloading a specified version of Julia and adding it to PATH. ## Table of Contents -- [Table of Contents](#table-of-contents) -- [Usage](#usage) - - [Inputs](#inputs) - - [Outputs](#outputs) - - [Basic](#basic) - - [Julia Versions](#julia-versions) - - [Matrix Testing](#matrix-testing) - - [versioninfo](#versioninfo) -- [Versioning](#versioning) -- [Debug logs](#debug-logs) -- [Third party information](#third-party-information) +- [setup-julia Action](#setup-julia-action) + - [Table of Contents](#table-of-contents) + - [Usage](#usage) + - [Inputs](#inputs) + - [Outputs](#outputs) + - [Basic](#basic) + - [Julia Versions](#julia-versions) + - [Examples](#examples) + - [Prereleases](#prereleases) + - [Recently released versions](#recently-released-versions) + - [Matrix Testing](#matrix-testing) + - [64-bit Julia only](#64-bit-julia-only) + - [32-bit Julia](#32-bit-julia) + - [versioninfo](#versioninfo) + - [Versioning](#versioning) + - [Using Dependabot version updates to keep your GitHub Actions up to date](#using-dependabot-version-updates-to-keep-your-github-actions-up-to-date) + - [Debug logs](#debug-logs) + - [Third party information](#third-party-information) + - [Contributing to this repo](#contributing-to-this-repo) ## Usage @@ -30,7 +38,7 @@ This action sets up a Julia environment for use in actions by downloading a spec # Warning: It is strongly recommended to wrap this value in quotes. # Otherwise, the YAML parser used by GitHub Actions parses certain # versions as numbers which causes the wrong version to be selected. - # For example, `1.0` may be parsed as `1`. + # For example, `1.10` may be parsed as `1.1`. # # Default: '1' version: '' diff --git a/action.yml b/action.yml index 69b6c10..bae3604 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: 'Setup a Julia environment and add it to the PATH' author: 'Sascha Mann' inputs: version: - description: 'The Julia version to download (if necessary) and use. Example: 1.0.4' + description: 'The Julia version to download (if necessary) and use. Use a string input to avoid unwanted decimal conversion e.g. 1.10 without quotes will be interpreted as 1.1. Examples: "1", "1.10", "lts", "pre"' default: '1' include-all-prereleases: description: 'Include prereleases when matching the Julia version to available versions.' diff --git a/lib/setup-julia.js b/lib/setup-julia.js index 8ce6323..12efc1a 100644 --- a/lib/setup-julia.js +++ b/lib/setup-julia.js @@ -80,6 +80,9 @@ function run() { if (!versionInput) { // if `versionInput` is an empty string throw new Error('Version input must not be null'); } + if (versionInput == '1.6') { + core.notice('[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.'); + } if (!originalArchInput) { // if `originalArchInput` is an empty string throw new Error(`Arch input must not be null`); } diff --git a/src/setup-julia.ts b/src/setup-julia.ts index 2e072ee..2156e22 100644 --- a/src/setup-julia.ts +++ b/src/setup-julia.ts @@ -53,6 +53,9 @@ async function run() { if (!versionInput) { // if `versionInput` is an empty string throw new Error('Version input must not be null') } + if (versionInput == '1.6') { + core.notice('[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.') + } if (!originalArchInput) { // if `originalArchInput` is an empty string throw new Error(`Arch input must not be null`) }