From 4f2b54a3fffdffeafc3264292f922a3db731f2c9 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Tue, 13 Aug 2024 12:11:46 +0200 Subject: [PATCH 1/3] Exchange unwanted dependency with manual step (#76) * Exchange unwanted dependency with manual step * Test in both macos-12 and macos-14 * Debug macOS issue --- .github/workflows/selftest.yml | 2 +- action.yml | 43 +++++++++++++++------------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/selftest.yml b/.github/workflows/selftest.yml index 9f209a19..fbce260b 100644 --- a/.github/workflows/selftest.yml +++ b/.github/workflows/selftest.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-12, macos-14, windows-latest] target: [stable, nightly, source] runs-on: ${{ matrix.os }} diff --git a/action.yml b/action.yml index 68a9b679..553fabc1 100644 --- a/action.yml +++ b/action.yml @@ -107,33 +107,27 @@ runs: 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/configurator@v0.0.10 - with: - name: alr - url: https://github.com/alire-project/alire/releases/download/v2.0.0/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/configurator@v0.0.10 - with: - name: alr - url: https://github.com/alire-project/alire/releases/download/v2.0.0/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/configurator@v0.0.10 - with: - name: alr.exe - url: https://github.com/alire-project/alire/releases/download/v2.0.0/alr-2.0.0-bin-x86_64-windows.zip - pathInArchive: bin/alr.exe - + # Download a stable alr capable of installing a toolchain + - name: Install GNAT (I) + if: steps.need-GNAT.outputs.need == 'true' + shell: bash + run: | + os_lower=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]') + alr_version=2.0.1 + curl -L -O https://github.com/alire-project/alire/releases/download/v${alr_version}/alr-${alr_version}-bin-x86_64-${os_lower}.zip + unzip alr-${alr_version}-bin-x86_64-${os_lower}.zip + rm alr-${alr_version}-bin-x86_64-${os_lower}.zip + echo "$PWD/bin" >> $GITHUB_PATH + + # Perform the actual `alr install` and remove the `alr` just used to avoid + # conflicts with the `alr` being built. + # TODO: we use gnat^13 because there seems to be some trouble with gnat^14 + # on macOS. Revisit this when the issue is resolved. - name: Install GNAT (II) if: steps.need-GNAT.outputs.need == 'true' shell: bash run: | - alr install gnat_native gprbuild --prefix=$PWD/setup_alire_prefix + alr install gnat_native^13 gprbuild^22 --prefix=$PWD/setup_alire_prefix echo REMOVAL TARGET: $(which alr) rm -f $(which alr)* && echo REMOVED stable alr used for toolchain install @@ -171,7 +165,8 @@ runs: if: steps.need-GNAT.outputs.need == 'true' shell: bash run: | - rm -rf setup_alire_prefix && echo REMOVED toolchain used to build alr + rm -rf setup_alire_prefix && \ + echo REMOVED toolchain used to build alr at $PWD/setup_alire_prefix # Display result for the record, and do some housekeeping - shell: bash From 81e3dba21ea4917fe6fdb3958bb5675006b26393 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Tue, 13 Aug 2024 12:46:12 +0200 Subject: [PATCH 2/3] Simplify addition to path step (#77) --- action.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 553fabc1..208fe254 100644 --- a/action.yml +++ b/action.yml @@ -131,18 +131,13 @@ runs: 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 - - - name: Install GNAT (III) - Add to path (!Windows) - if: steps.need-GNAT.outputs.need == 'true' && runner.os != 'Windows' + - name: Install GNAT (III) - Add to path + if: steps.need-GNAT.outputs.need == 'true' shell: bash run: | - readlink -f "$PWD/setup_alire_prefix/bin" >> $GITHUB_PATH + path_to_add=$(pwd -W 2>/dev/null || pwd)/setup_alire_prefix/bin + echo Adding to PATH: $path_to_add + echo "$path_to_add" >> $GITHUB_PATH # END TOOLCHAIN INSTALLATION From b607671067a8ca5d7b7f4a12dadb4dc009cd2cc7 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Tue, 13 Aug 2024 18:54:44 +0200 Subject: [PATCH 3/3] Don't leave traces behind of temporary alr (#78) --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 208fe254..2dae233d 100644 --- a/action.yml +++ b/action.yml @@ -115,9 +115,9 @@ runs: os_lower=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]') alr_version=2.0.1 curl -L -O https://github.com/alire-project/alire/releases/download/v${alr_version}/alr-${alr_version}-bin-x86_64-${os_lower}.zip - unzip alr-${alr_version}-bin-x86_64-${os_lower}.zip + unzip -o alr-${alr_version}-bin-x86_64-${os_lower}.zip "bin/alr*" -d tmp_alr rm alr-${alr_version}-bin-x86_64-${os_lower}.zip - echo "$PWD/bin" >> $GITHUB_PATH + echo "$(pwd -W 2>/dev/null || pwd)/tmp_alr/bin" >> $GITHUB_PATH # Perform the actual `alr install` and remove the `alr` just used to avoid # conflicts with the `alr` being built. @@ -129,7 +129,7 @@ runs: run: | alr install gnat_native^13 gprbuild^22 --prefix=$PWD/setup_alire_prefix echo REMOVAL TARGET: $(which alr) - rm -f $(which alr)* && echo REMOVED stable alr used for toolchain install + rm -rf tmp_alr && echo REMOVED stable alr used for toolchain install - name: Install GNAT (III) - Add to path if: steps.need-GNAT.outputs.need == 'true'