diff --git a/.github/workflows/install-compiler-ubuntu/action.yml b/.github/workflows/install-compiler-ubuntu/action.yml new file mode 100644 index 0000000000..867c2cd5da --- /dev/null +++ b/.github/workflows/install-compiler-ubuntu/action.yml @@ -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 Add assertion for unsupported compiler version. \ No newline at end of file diff --git a/.github/workflows/install-dependencies-ubuntu/action.yml b/.github/workflows/install-dependencies-ubuntu/action.yml index 555fc5dbcd..4f7a8a2d9a 100644 --- a/.github/workflows/install-dependencies-ubuntu/action.yml +++ b/.github/workflows/install-dependencies-ubuntu/action.yml @@ -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 diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml index 17559f60d0..c89d62e56b 100644 --- a/.github/workflows/native-build.yml +++ b/.github/workflows/native-build.yml @@ -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