Merge branch 'gnatformat-issue_52' into 'master' #983
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
on: | |
push: | |
branches: | |
- master | |
name: Build binaries | |
jobs: | |
build: | |
name: Build and deploy | |
strategy: | |
fail-fast: false | |
matrix: # Build debug and/or production | |
debug: [''] # '' if production, 'debug' for debug | |
os: [macos-11, ubuntu-20.04, windows-latest] | |
cross: ['', aarch64] | |
exclude: | |
- os: windows-latest | |
cross: aarch64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- run: git config --global core.autocrlf input | |
shell: bash | |
- name: Install cross toolchain (Linux) | |
if: ${{ matrix.cross != '' && runner.os == 'Linux' }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} | |
AWS_DEFAULT_REGION: eu-west-1 | |
run: | | |
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu | |
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256 | |
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256 | |
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C / | |
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C / | |
- name: Install cross toolchain (MacOS) | |
if: ${{ matrix.cross != '' && runner.os != 'Linux' }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} | |
AWS_DEFAULT_REGION: eu-west-1 | |
run: | | |
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256 | |
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256 | |
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 --strip-components=3 -C /usr/local | |
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 --strip-components=3 -C /usr/local | |
- name: Force Alire to use preinstalled MSYS2 | |
if: ${{ runner.os == 'Windows' }} | |
shell: bash | |
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' }} | |
shell: c:\msys64\usr\bin\bash.exe -l -e -o pipefail {0} | |
env: | |
MSYSTEM: MINGW64 | |
- name: Get libadalang | |
uses: actions/checkout@v3 | |
- name: Get gprbuild for libgpr | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gprbuild | |
path: gprbuild | |
- name: Get gnatcoll core | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gnatcoll-core | |
path: gnatcoll-core | |
- name: Get gnatcoll iconv/gmp | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gnatcoll-bindings | |
path: gnatcoll-bindings | |
- name: Get langkit | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/langkit | |
path: langkit | |
fetch-depth: 0 # all branches | |
- name: Get gpr | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gpr | |
path: gpr2 | |
- name: Get gprconfig kb | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gprconfig_kb | |
path: gpr2/gprconfig_kb | |
- name: Get AdaSAT | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/AdaSAT | |
path: langkit/langkit/adasat | |
- name: Get prettier-ada | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/prettier-ada | |
path: prettier-ada | |
- name: Get VSS | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/VSS | |
path: VSS | |
- name: Try to checkout langkit's branch | |
shell: bash | |
run: (cd langkit; git checkout ${{ github.ref }} || true) | |
- uses: actions/cache@v3 | |
with: | |
path: ./cached_gnat | |
key: ${{ runner.os }}-alire-2023 | |
- name: Get GNAT toolchain with alire | |
uses: alire-project/setup-alire@v2 | |
with: | |
toolchain: gnat_native^13 gprbuild^22 | |
toolchain_dir: ./cached_gnat | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Build Libadalang and its dependencies | |
shell: bash | |
run: utils/gh-build-binaries.sh "${{ matrix.debug }}" ${{ runner.os }} "${{ matrix.cross }}" | |
- name: Keep artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }}-${{ matrix.debug }}${{ matrix.cross }} | |
path: '*.tar.gz' | |
- name: AWS S3 upload | |
if: ${{ github.repository == 'AdaCore/libadalang' }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} | |
AWS_DEFAULT_REGION: eu-west-1 | |
shell: bash | |
run: | | |
for file in *.tar.gz ; do | |
aws s3 cp "$file" s3://adacore-gha-tray-eu-west-1/libadalang/ --sse=AES256 | |
done | |
aws s3 ls s3://adacore-gha-tray-eu-west-1/libadalang/ |