Skip to content

Commit

Permalink
Replace CE with latest FSF from Alire (#746)
Browse files Browse the repository at this point in the history
* Replace CE with latest FSF from Alire

Also remove extra installations that are now automatically performed by the
setup-alire action.

* Remove now-redundant workflow cases
  • Loading branch information
mosteo authored Feb 22, 2023
1 parent cc6b374 commit cf27f32
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Please read the TESTING file before modifying this file

name: Build Crate
name: Build Crate (Distro toolchain)
# Build the crate on the platforms with a supported package manager
# and using the distro-supplied GNAT compiler (with Alire's FSF fallback).

env:
CHECKS_ORG: alire-project
Expand All @@ -15,46 +17,18 @@ on:
jobs:

build:
name: ${{ matrix.os }}::${{ matrix.tag }}
name: ${{ matrix.tag }}

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
tag:
- arch-rolling # Arch has its own recent GNAT and pacman
- centos-stream-fsf-latest # CentOS is used for unknown package manager
- debian-stable # Debian has very good Ada support and apt
- fedora-latest # Fedora has its own GNAT and dnf
- ubuntu-lts # Ubuntu LTS is a common Debian derivative
- ""
exclude: # inclusions don't allow to add arrays of values to a scenario
- os: ubuntu-latest
tag: ""
- os: macos-latest
tag: arch-rolling
- os: macos-latest
tag: centos-stream-fsf-latest
- os: macos-latest
tag: debian-stable
- os: macos-latest
tag: fedora-latest
- os: macos-latest
tag: ubuntu-lts
- os: windows-latest
tag: arch-rolling
- os: windows-latest
tag: centos-stream-fsf-latest
- os: windows-latest
tag: debian-stable
- os: windows-latest
tag: fedora-latest
- os: windows-latest
tag: ubuntu-lts

steps:
- name: Check out alire-index
Expand All @@ -77,45 +51,23 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: sudo apt update

- name: Set up GNAT toolchain (FSF)
if: matrix.os == 'ubuntu-latest'
uses: ada-actions/toolchain@ce2021
with:
distrib: fsf # faster install?

- name: Set up GNAT toolchain (Community)
if: matrix.os != 'ubuntu-latest'
uses: ada-actions/toolchain@ce2020
with:
distrib: community

- name: Set up stable `alr`
if: contains(github.base_ref, 'stable-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
toolchain: --disable-assistant # We want to use the external ones in this workflow
version: ${{env.ALR_VERSION}}

- name: Set up devel `alr`
if: contains(github.base_ref, 'devel-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
toolchain: --disable-assistant # We want to use the external ones in this workflow
branch: master

- name: Test crate (Linux)
if: matrix.os == 'ubuntu-latest' # docker testing only for linuxes
uses: mosteo/actions@docker-run/v1
- name: Test crate (${{matrix.tag}})
uses: mosteo-actions/docker-run@v1
with:
image: alire/gnat:${{matrix.tag}}
command: ${{env.CHECKS_REPO}}/scripts/gh-build-crate.sh
params: -v ${{ github.workspace }}/alire_install/bin/alr:/usr/bin/alr

- name: Install tar from msys2 (Windows) # Git tar in Actions VM does not seem to work)
if: matrix.os == 'windows-latest'
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S tar

- name: Test crate (Windows/MacOS)
if: matrix.os != 'ubuntu-latest' # native testing in Windows/MacOS
run: ${{env.CHECKS_REPO}}/scripts/gh-build-crate.sh
shell: bash
params: -v ${{ github.workspace }}/alire_install/bin/alr:/usr/bin/alr
24 changes: 4 additions & 20 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Please read the TESTING file before modifying this file

name: Toolchain
# Build the submitted crate with a native toolchain from Alire
name: Build Crate (Alire toolchain)
# Build the crate with a native toolchain from Alire

env:
CHECKS_ORG: alire-project
Expand Down Expand Up @@ -44,33 +44,17 @@ jobs:
ref: ${{github.base_ref}}
path: ${{env.CHECKS_REPO}}

# For the devel branch we need a compiler available to build alr in
# setup-alire. We will be able to get rid of this once composite actions
# support conditional steps.

- name: Set up GNAT toolchain (FSF)
if: (matrix.os == 'ubuntu-latest') && (contains(github.base_ref, 'devel-'))
uses: ada-actions/toolchain@ce2020
with:
distrib: fsf # faster install?

- name: Set up GNAT toolchain (Community)
if: (matrix.os != 'ubuntu-latest') && (contains(github.base_ref, 'devel-'))
uses: ada-actions/toolchain@ce2020
with:
distrib: community

# By default, this sets up the newest indexed native toolchain
- name: Set up stable `alr`
if: contains(github.base_ref, 'stable-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
version: ${{env.ALR_VERSION}}

# By default, this sets up the newest indexed native toolchain
- name: Set up devel `alr`
if: contains(github.base_ref, 'devel-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
branch: 'master'

Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/diff-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,14 @@ jobs:

- name: Set up stable `alr`
if: contains(github.base_ref, 'stable-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
toolchain: --disable-assistant # We don't need the compiler
version: ${{env.ALR_VERSION}}

- name: Set up GNAT toolchain (FSF)
if: (matrix.os == 'ubuntu-latest') && (contains(github.base_ref, 'devel-'))
uses: ada-actions/toolchain@ce2020
with:
distrib: fsf # faster install?

- name: Set up GNAT toolchain (Community)
if: (matrix.os != 'ubuntu-latest') && (contains(github.base_ref, 'devel-'))
uses: ada-actions/toolchain@ce2020
with:
distrib: community

- name: Set up devel `alr`
if: contains(github.base_ref, 'devel-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
toolchain: --disable-assistant # We don't need the compiler
branch: master
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ jobs:

- name: Set up stable `alr`
if: contains(github.base_ref, 'stable-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
version: 1.2.1

- name: Set up GNAT for devel `alr`
if: contains(github.base_ref, 'devel-')
uses: ada-actions/toolchain@ce2020
with:
distrib: fsf
version: 1.2.2

- name: Set up devel `alr`
if: contains(github.base_ref, 'devel-')
uses: alire-project/setup-alire@v1
uses: alire-project/setup-alire@v2
with:
branch: master

Expand Down

0 comments on commit cf27f32

Please sign in to comment.