Skip to content

Commit

Permalink
also add an action for the compiler installation
Browse files Browse the repository at this point in the history
  • Loading branch information
joka921 committed Dec 11, 2023
1 parent 2918935 commit 6980791
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/install-compiler-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Install various versions of gcc and clang"
description: "dummy description"
inputs:
compiler:
description: "Must be `gcc` or `clang`"
required: true
compiler-version:
description: "the version of the compiler (must be major version)"
required: true

runs:
using: "composite"
steps:
- name: Add PPA for GCC
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update
shell: bash
if : inputs.compiler == 'gcc'

- name: Install gcc 11
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-11 g++-11
if : inputs.compiler == 'gcc' && inputs.compiler-version == 11
shell: bash
- name: Install gcc 12
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-12 g++-12
if : inputs.compiler == 'gcc' && inputs.compiler-version == 12
shell: bash
- name: Install gcc 13
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-13 g++-13
if : inputs.compiler == 'gcc' && inputs.compiler-version == 13
shell: bash
- name: Install clang
# The sed command fixes a bug in `llvm.sh` in combination with the latest version of
# `apt-key`. Without it the GPG key for the llvm repository is downloaded but deleted
# immediately after.
run: |
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sed 's/apt-key del/echo/' llvm.sh -iy
sudo ./llvm.sh ${{inputs.compiler-version}}
sudo apt install -y clang-${{inputs.compiler-version}}
if : inputs.compiler == 'clang'
shell: bash
# TODO<joka921> Add assertion for unsupported compiler version.
3 changes: 3 additions & 0 deletions .github/workflows/install-dependencies-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ runs:
- name: Install boost from PPa
run: sudo add-apt-repository -y ppa:mhier/libboost-latest && sudo apt update && sudo apt install -y libboost1.81-all-dev libboost-url1.81-dev
shell: bash
- name: Install python packages for E2E tests
run: sudo apt-get install python3-yaml unzip pkg-config python3-icu
shell: bash
30 changes: 6 additions & 24 deletions .github/workflows/native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,13 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: install-dependencies
- name: Install dependencies
uses: ./.github/workflows/install-dependencies-ubuntu
- name: Install gcc 11
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-11 g++-11
if : matrix.compiler == 'gcc' && matrix.compiler-version == 11
- name: Install gcc 12
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-12 g++-12
if : matrix.compiler == 'gcc' && matrix.compiler-version == 12

- name: Install gcc 13
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-13 g++-13
if : matrix.compiler == 'gcc' && matrix.compiler-version == 13

- name: Install clang
# The sed command fixes a bug in `llvm.sh` in combination with the latest version of
# `apt-key`. Without it the GPG key for the llvm repository is downloaded but deleted
# immediately after.
run: |
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sed 's/apt-key del/echo/' llvm.sh -iy
sudo ./llvm.sh ${{matrix.compiler-version}}
sudo apt install -y clang-${{matrix.compiler-version}}
if : matrix.compiler == 'clang'

- name: Install compiler
uses: ./.github/workflows/install-compiler-ubuntu
with:
compiler: matrix.compiler
compiler-version: matrix.compiler-version
- name: Python dependencies
run: sudo apt-get install python3-yaml unzip pkg-config python3-icu

Expand Down

0 comments on commit 6980791

Please sign in to comment.