Skip to content

Commit

Permalink
Merge branch 'topic/fix_gh_ci' into 'master'
Browse files Browse the repository at this point in the history
GitHub CI: Use GCC 13 to build ALS

See merge request eng/ide/ada_language_server!1411
  • Loading branch information
reznikmm committed Oct 19, 2023
2 parents d258654 + c085ca3 commit b2ebac8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 33 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
set -x -e
DEBUG=$1 # Value is '' or 'debug'
RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windiws, maxOS
TAG=$3 # For master it's 23.0.999, while for tag it's the tag itself
TAG=$3 # For master it's 24.0.999, while for tag it's the tag itself
NO_REBASE=$4 # Specify this to skip the rebase over the edge branch. Used for local debugging.

prefix=/tmp/ADALIB_DIR

export CPATH=/usr/local/include
export LIBRARY_PATH=/usr/local/lib
export DYLD_LIBRARY_PATH=/usr/local/lib
export PATH=`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH
export ADAFLAGS=-g1

if [ $RUNNER_OS = Windows ]; then
prefix=/opt/ADALIB_DIR
mount `cygpath -w $RUNNER_TEMP|cut -d: -f1`:/opt /opt
export CPATH=`cygpath -w /c/msys64/mingw64/include`
export LIBRARY_PATH=`cygpath -w /c/msys64/mingw64/lib`
mount D:/opt /opt
fi

export GPR_PROJECT_PATH=$prefix/share/gpr:\
Expand All @@ -22,11 +30,6 @@ $PWD/subprojects/lal-refactor/gnat:\
$PWD/subprojects/libadalang-tools/src:\
$PWD/subprojects/spawn/gnat:\
$PWD/subprojects/stubs
export CPATH=/usr/local/include:/mingw64/include
export LIBRARY_PATH=/usr/local/lib:/mingw64/lib
export DYLD_LIBRARY_PATH=/usr/local/lib
export PATH=`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH
export ADAFLAGS=-g1
echo PATH=$PATH

BRANCH=master
Expand Down Expand Up @@ -57,6 +60,7 @@ FILE=libadalang-$RUNNER_OS-$BRANCH${DEBUG:+-dbg}-static.tar.gz
# and we don't delete it after use.
if [ ! -f "$FILE" ]; then
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/$FILE . --sse=AES256
umask 0 # To avoid permission errors on MSYS2
tar xzf $FILE -C $prefix
rm -f -v $FILE
else
Expand Down
41 changes: 19 additions & 22 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 2*.*.*
name: Build binaries
env:
DEFAULT_TAG: 23.0.999
DEFAULT_TAG: 24.0.999
AWS_DEFAULT_REGION: eu-west-1
jobs:
build:
Expand All @@ -18,10 +18,10 @@ jobs:
os: [macos-11, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python 3.8
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
- name: Initialize TAG and git autocrlf
shell: bash
run: |
Expand All @@ -31,15 +31,19 @@ jobs:
else
echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV
fi
- name: Force Alire use preinstalled MSYS2
shell: bash
if: ${{ runner.os == 'Windows' }}
run: |
mkdir -p ~/.config/alire
echo '[msys2]' >> ~/.config/alire/config.toml
echo 'install_dir = "C:\\msys64"' >> ~/.config/alire/config.toml
- name: Install iconv and gmp (Windows only)
run: pacman --noconfirm -S mingw64/mingw-w64-x86_64-libiconv mingw64/mingw-w64-x86_64-gmp
if: ${{ runner.os == 'Windows' }}
uses: msys2/setup-msys2@v2
with:
path-type: inherit
update: true
install: >-
mingw64/mingw-w64-x86_64-libiconv
mingw64/mingw-w64-x86_64-gmp
shell: c:\msys64\usr\bin\bash.exe -l -e -o pipefail {0}
env:
MSYSTEM: MINGW64
- name: Get als
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -79,29 +83,22 @@ jobs:
- uses: actions/cache@v3
with:
path: ./cached_gnat
key: ${{ runner.os }}-alire-2022
restore-keys: ${{ runner.os }}-alire-2022
key: ${{ runner.os }}-alire-2023
restore-keys: ${{ runner.os }}-alire-2023
- name: Get GNAT toolchain with alire
uses: alire-project/setup-alire@v2
with:
toolchain: gnat_native^12 gprbuild^22
toolchain: gnat_native^13 gprbuild^22
toolchain_dir: ./cached_gnat
- name: Build (Windows)
if: ${{ runner.os == 'Windows' }}
shell: msys2 {0}
- name: Build
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
run: |
# This is to avoid locking .sh on win that prevents its updating
cp .github/workflows/build-binaries.sh .github/workflows/build-binaries.sh_
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }}
- name: Build (non-Windows)
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
if: ${{ runner.os != 'Windows' }}
run: .github/workflows/build-binaries.sh "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }}
- name: Archive ALS binary
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pack-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -x -e
DEBUG=$1 # Value is '' or 'debug'
VSCE_TOKEN=$2
OVSX_TOKEN=$3
TAG=$4 # For master it's 23.0.999, while for tag it's the tag itself
TAG=$4 # For master it's 24.0.999, while for tag it's the tag itself

function make_change_log()
{
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ else
endif

all: coverage-instrument
$(GPRBUILD) -P gnat/lsp_3_17.gpr -p $(COVERAGE_BUILD_FLAGS) -c lsp-inputs.adb
$(GPRBUILD) -P gnat/lsp_3_17.gpr -p $(COVERAGE_BUILD_FLAGS)
$(GPRBUILD) -P gnat/tester.gpr -p $(BUILD_FLAGS)
$(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb
Expand Down
2 changes: 2 additions & 0 deletions gnat/lsp_3_17.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ project LSP_3_17 is

package Compiler is
for Default_Switches ("Ada") use Common_Ada_Switches & Ada_Switches;
for Switches ("lsp-inputs.adb") use
Common_Ada_Switches & Ada_Switches & ("-O0");
for Local_Configuration_Pragmas use "gnat.adc";
end Compiler;

Expand Down
4 changes: 2 additions & 2 deletions integration/vscode/ada/package-lock.json

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

2 changes: 1 addition & 1 deletion integration/vscode/ada/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ada",
"displayName": "Language Support for Ada",
"description": "A Language Server providing Ada and SPARK support in Visual Studio Code",
"version": "23.0.999",
"version": "24.0.999",
"publisher": "AdaCore",
"license": "GPL-3.0",
"engines": {
Expand Down

0 comments on commit b2ebac8

Please sign in to comment.