Skip to content

Commit

Permalink
New branch v3 that defaults to alr 2.0 (#60)
Browse files Browse the repository at this point in the history
* New branch v3 that defaults to `alr 2.0`

* Remove --install-dir processing
  • Loading branch information
mosteo authored Mar 13, 2024
1 parent 594462b commit 2c67b8f
Show file tree
Hide file tree
Showing 300 changed files with 36,487 additions and 2,932 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ jobs:

steps:
- name: Check on proper branch
if: github.head_ref != 'v2-next'
if: github.head_ref != 'v3-next'
uses: actions/github-script@v3
with:
script: |
core.setFailed(`PRs for latest-stable must come from v2-next, but branch is ${{ github.head_ref }}`)
- name: Setup stable
uses: alire-project/setup-alire@v2-next
uses: alire-project/setup-alire@v3-next
if: matrix.target == 'stable'
with:
cache: false
# We test without cache, as caching is tested in a separate workflow.
# This way we make sure the cache isn't hiding any issue.

- name: Setup nightly
uses: alire-project/setup-alire@v2-next
uses: alire-project/setup-alire@v3-next
if: matrix.target == 'nightly'
with:
version: nightly
cache: false

- name: Setup from source (master)
uses: alire-project/setup-alire@v2-next
uses: alire-project/setup-alire@v3-next
if: matrix.target == 'source'
with:
branch: master
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test-cache.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes to the v2 branch must be proposed via PRs in the branch
# v2-next. This way we can check the action just as GHA is going to
# v3-next. This way we can check the action just as GHA is going to
# use it.

name: Test cache
Expand All @@ -12,9 +12,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: ['1.2.2', 'nightly', 'source']
version: ['2.0.0', '1.2.2', 'nightly', 'source']
branch: ['', 'master']
exclude: # These combos are redundant
- version: '2.0.0'
branch: master
- version: '1.2.2'
branch: master
- version: nightly
Expand All @@ -26,17 +28,17 @@ jobs:

steps:
- name: Check PR comes from proper branch
if: (github.head_ref || github.ref) != 'v2-next'
if: (github.head_ref || github.ref) != 'v3-next'
uses: actions/github-script@v3
with:
script: |
core.setFailed(`PRs for ${{github.base_ref}} must come from v2-next, but branch is ${{github.head_ref || github.ref}}`)
core.setFailed(`PRs for ${{github.base_ref}} must come from v3-next, but branch is ${{github.head_ref || github.ref}}`)
# This might hit cache

- name: Check action itself
id: attempt_1
uses: alire-project/setup-alire@v2-next
uses: alire-project/setup-alire@v3-next
with:
version: ${{matrix.version}}
branch: ${{matrix.branch}}
Expand All @@ -46,7 +48,7 @@ jobs:
- name: Check action itself
if: steps.attempt_1.outputs.cache_hit != 'true'
id: attempt_2
uses: alire-project/setup-alire@v2-next
uses: alire-project/setup-alire@v3-next
with:
version: ${{matrix.version}}
branch: ${{matrix.branch}}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ inputs:
version:
description: Use this argument to install a stable release. Use a version number without v prefix, e.g., 1.0.1, 1.1.0. This argument will be ignored if a branch argument is supplied. Defaults to the latest stable release.
required: false
default: '1.2.2'
default: '2.0.0'
branch:
description: Use this argument to install a development branch (e.g., master). Using this option will require a preexisting compiler in the workflow environment.
required: false
Expand Down
6 changes: 1 addition & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
version:
description: Use this argument to install a stable or nightly release. Use a version number without v prefix, e.g., 1.0.1, 1.1.0, or 'nightly'. This argument will be ignored if a branch argument is supplied. Defaults to the latest stable release.
required: false
default: '1.2.2'
default: '2.0.0'
# Also to be updated in test-cache-yml
branch:
description: Use this argument to install a development branch (e.g., master). Using this option will require a preexisting compiler in the workflow environment.
Expand All @@ -16,10 +16,6 @@ inputs:
description: Arguments to pass to `alr toolchain` after setup.
required: false
default: 'gnat_native gprbuild'
toolchain_dir:
description: Location to install toolchain under.
required: false
default: ''
cache:
description: Whether to reuse a cached previous install.
required: false
Expand Down
16 changes: 4 additions & 12 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,17 @@ function run() {
var version;
var branch;
var tool_args;
var tool_dir;
if (process.argv[2]) { // e.g., node lib/script.js <json object>
const inputs = JSON.parse(process.argv[2]);
version = inputs.version;
branch = inputs.branch;
tool_args = inputs.toolchain;
tool_dir = inputs.toolchain_dir;
}
else {
// Old way in case this is fixed by GH
version = core.getInput('version');
branch = core.getInput('branch');
tool_args = core.getInput('toolchain');
tool_dir = core.getInput('toolchain_dir');
}
// Install the requested version/branch unless cached
const cached = detect_cached();
Expand All @@ -157,15 +154,10 @@ function run() {
core.addPath(path_1.default.join(process.cwd(), install_dir, 'bin'));
// And configure the toolchain
if (tool_args.length > 0 && !cached) {
if (tool_dir.length == 0) {
yield exec.exec(`alr -n toolchain ${tool_args != "--disable-assistant" ? "--select " : ""} ${tool_args}`);
// Disable the assistant anyway if we have selected something. This will no longer be necessary after 1.1.1
if (tool_args != "--disable-assistant") {
yield exec.exec(`alr -n toolchain --disable-assistant`);
}
}
else {
yield exec.exec(`alr -n toolchain --install ${tool_args} --install-dir ${tool_dir}`);
yield exec.exec(`alr -n toolchain ${tool_args != "--disable-assistant" ? "--select " : ""} ${tool_args}`);
// Disable the assistant anyway if we have selected something. This will no longer be necessary after 1.1.1
if (tool_args != "--disable-assistant") {
yield exec.exec(`alr -n toolchain --disable-assistant`);
}
}
// Show the alr now in the environment and the configured toolchain
Expand Down
58 changes: 39 additions & 19 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/@actions/core/lib/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/oidc-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/oidc-utils.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@actions/core/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c67b8f

Please sign in to comment.