generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on GNAT CE when building branch
- Loading branch information
Showing
2 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,13 +77,64 @@ runs: | |
id: find-gnat | ||
run: gnat --version && echo "available=true" >> $GITHUB_OUTPUT || echo "available=false" >> $GITHUB_OUTPUT | ||
|
||
# Setup a GNAT if necessary to build from branch. | ||
# We cannot use alr-install or setup-alire, as that creates infinite recursion. | ||
- name: Install GNAT | ||
# Setup a GNAT if necessary to build from branch. We cannot use alr-install | ||
# as that creates infinite recursion. Rather than relying on the old action | ||
# that sets up CE editions, we simply fetch a stable alr capable of running | ||
# `alr install`, and we use that to install the latest FSF GNAT. | ||
|
||
# BEGIN TOOLCHAIN INSTALLATION | ||
|
||
- name: Identify need for GNAT | ||
if: inputs.branch != '' && steps.find-gnat.outputs.available != 'true' && steps.cache-alr.outputs.cache-hit != 'true' | ||
uses: ada-actions/toolchain@ce2020 | ||
id: need-GNAT | ||
shell: bash | ||
run: echo "need=true" >> $GITHUB_OUTPUT | ||
|
||
- name: Install GNAT (I) Linux | ||
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Linux' | ||
uses: engineerd/[email protected] | ||
with: | ||
name: alr | ||
url: alr-2.0.0-bin-x86_64-linux.zip | ||
pathInArchive: bin/alr | ||
- name: Install GNAT (I) macOS | ||
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'macOS' | ||
uses: engineerd/[email protected] | ||
with: | ||
distrib: community | ||
name: alr | ||
url: alr-2.0.0-bin-x86_64-macos.zip | ||
pathInArchive: bin/alr | ||
- name: Install GNAT (I) Windows | ||
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Windows' | ||
uses: engineerd/[email protected] | ||
with: | ||
name: alr.exe | ||
url: alr-2.0.0-bin-x86_64-windows.zip | ||
pathInArchive: bin/alr.exe | ||
|
||
- name: Install GNAT (II) | ||
if: steps.need-GNAT.outputs.need == 'true' | ||
shell: bash | ||
run: | | ||
alr install gnat_native gprbuild --prefix=$PWD/setup_alire_prefix | ||
echo REMOVAL TARGET: $(which alr) | ||
rm -f $(which alr)* && echo REMOVED stable alr used for toolchain install | ||
- name: Install GNAT (III) - Add to path (Windows) | ||
if: steps.need-GNAT.outputs.need == 'true' && runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
$Target = Resolve-Path .\setup_alire_prefix\bin | ||
Add-Content $env:GITHUB_PATH $Target | ||
echo $Target | ||
- name: Install GNAT (III) - Add to path (!Windows) | ||
if: steps.need-GNAT.outputs.need == 'true' && runner.os != 'Windows' | ||
shell: bash | ||
run: | | ||
readlink -f "$PWD/setup_alire_prefix/bin" >> $GITHUB_PATH | ||
# END TOOLCHAIN INSTALLATION | ||
|
||
# To run the old setup action which is javascript | ||
- name: Setup Node | ||
|
@@ -98,6 +149,14 @@ runs: | |
shell: bash | ||
# on Windows, backlashes mess things for bash, and powershell chokes on toJSON output | ||
|
||
# Remove our installed toolchain as not to interfere with other | ||
# actions/workflows down the line | ||
- name: Remove GNAT (IV) | ||
if: steps.need-GNAT.outputs.need == 'true' | ||
shell: bash | ||
run: | | ||
rm -rf setup_alire_prefix && echo REMOVED toolchain used to build alr | ||
# Display result for the record | ||
- shell: bash | ||
run: | | ||
|