Skip to content

Commit 8d805df

Browse files
committed
[workflows] Update GitHub actions to use modern tools
Cherry-pick patches from release_17x, in order to build the release_16x branch of classic-flang-llvm-project and flang with GCC 12 and Clang 14/15 on Ubuntu 22.04. This squashes together the following commits: e698fc8 [workflows] Update GitHub actions to use modern tools 6aeab31 [workflows] Fix GitHub action bugs 77979af [workflows] Fix typo in pre-compile_llvm.yml; NFC The workflows in the flang repository test both release_16x and release_17x, and keeping the workflows consistent in these classic-flang-llvm-project branches simplifies the flang workflows.
1 parent 382b193 commit 8d805df

File tree

5 files changed

+34
-51
lines changed

5 files changed

+34
-51
lines changed

.github/workflows/Ubuntu20Dockerfile renamed to .github/workflows/UbuntuDockerfile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
ENV TZ=Europe/London
@@ -24,23 +24,17 @@ RUN apt-get update && \
2424
RUN apt-get install -y software-properties-common && \
2525
apt-get update && \
2626
add-apt-repository ppa:ubuntu-toolchain-r/test && \
27-
apt-get install -f -y gcc-9 g++-9 && \
28-
apt-get install -f -y gcc-10 g++-10 && \
29-
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list.d/llvm.list && \
30-
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list.d/llvm.list && \
31-
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
32-
apt-get update && \
33-
apt-get install -f -y llvm-9 clang-9 && \
34-
apt-get install -f -y llvm-10 clang-10 && \
35-
apt-get install -f -y llvm-11 clang-11
27+
apt-get install -f -y gcc-12 g++-12 && \
28+
apt-get install -f -y llvm-14 clang-14 && \
29+
apt-get install -f -y llvm-15 clang-15
3630

3731
# Install the tools for release_13x and newer
3832
RUN apt --fix-missing update && \
3933
apt install -y build-essential manpages-dev \
4034
libssl-dev zlib1g-dev \
4135
libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev && \
4236
apt install -y python3-distutils python3-psutil \
43-
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
37+
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
4438

4539
RUN cd /opt && \
4640
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.sh && \
@@ -57,7 +51,7 @@ RUN if [ "$INITIAL_BUILD" != "true" ]; then \
5751
mkdir /home/root && cd home/root && \
5852
git clone --depth 1 --single-branch --branch $BRANCH_NAME https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
5953
cd classic-flang-llvm-project && \
60-
./build-llvm-project.sh -t AArch64 -p /home/github/usr/local -n `nproc --ignore=1` -a /usr/bin/gcc-10 -b /usr/bin/g++-10 -i -x "-DLLVM_ENABLE_ASSERTIONS=ON" -v; \
54+
./build-llvm-project.sh -t AArch64 -p /home/github/usr/local -n `nproc --ignore=1` -a /usr/bin/gcc-12 -b /usr/bin/g++-12 -i -x "-DLLVM_ENABLE_ASSERTIONS=ON" -v; \
6155
fi
6256

6357
RUN useradd github && \

.github/workflows/build_push_docker_image_Ubuntu20.yml renamed to .github/workflows/build_push_docker_image_Ubuntu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
branches:
1212
- 'release_*x'
1313
paths-include:
14-
- '**/.github/workflows/build_push_docker_image_Ubuntu20.yml'
15-
- '**/.github/workflows/Ubuntu20Dockerfile.yml'
14+
- '**/.github/workflows/build_push_docker_image_Ubuntu.yml'
15+
- '**/.github/workflows/UbuntuDockerfile.yml'
1616

1717
jobs:
1818
docker:
@@ -38,11 +38,11 @@ jobs:
3838
- name: Build and push
3939
uses: docker/build-push-action@v2
4040
with:
41-
file: .github/workflows/Ubuntu20Dockerfile
41+
file: .github/workflows/UbuntuDockerfile
4242
push: true
4343
no-cache: true
4444
context: .github/workflows
45-
tags: ghcr.io/${{ github.repository_owner }}/ubuntu20-flang-${{ steps.extract_branch.outputs.branch }}:latest
45+
tags: ghcr.io/${{ github.repository_owner }}/ubuntu-flang-${{ steps.extract_branch.outputs.branch }}:latest
4646
platforms: linux/arm64
4747
build-args: |
4848
BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}

.github/workflows/flang-arm64-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
build_path: /home/github
1313
install_prefix: /home/github/usr/local
1414
container:
15-
image: ghcr.io/${{ github.repository_owner}}/ubuntu20-flang-${{ github.base_ref }}:latest
15+
image: ghcr.io/${{ github.repository_owner}}/ubuntu-flang-${{ github.base_ref }}:latest
1616
credentials:
1717
username: github
1818
strategy:
1919
matrix:
2020
target: [AArch64]
2121
cc: [clang]
2222
cpp: [clang++]
23-
version: [10, 11]
23+
version: [14, 15]
2424
include:
2525
- target: AArch64
2626
cc: gcc
2727
cpp: g++
28-
version: 10
28+
version: 12
2929

3030
steps:
3131
- name: Check tools

.github/workflows/flang-tests.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ on:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
env:
1212
install_prefix: /usr/local
1313
strategy:
1414
matrix:
1515
target: [X86]
1616
cc: [clang]
1717
cpp: [clang++]
18-
version: [10, 11]
18+
version: [14, 15]
1919
include:
2020
- target: X86
2121
cc: gcc
2222
cpp: g++
23-
version: 10
23+
version: 12
2424

2525
steps:
2626
- uses: actions/checkout@v2
@@ -29,20 +29,15 @@ jobs:
2929
run: |
3030
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
3131
sudo touch /etc/apt/sources.list.d/llvm.list
32-
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
33-
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
34-
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
3532
sudo apt update
3633
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version}}
3734
38-
- if: matrix.cc == 'gcc' && matrix.version == '10'
35+
- if: matrix.cc == 'gcc'
3936
run: |
4037
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
41-
sudo apt install gcc-10 g++-10
42-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
43-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20
44-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10
45-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20
38+
sudo apt install gcc-${{ matrix.version }} g++-${{ matrix.version }}
39+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 20
40+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} 20
4641
4742
- name: ccache
4843
uses: hendrikmuhs/ccache-action@v1

.github/workflows/pre-compile_llvm.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,38 @@ on:
99
jobs:
1010
build:
1111
name: Ubuntu Linux
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
strategy:
1414
matrix:
1515
target: [X86]
16-
cc: [clang, gcc]
17-
version: [10, 11]
16+
cc: [clang]
17+
cpp: [clang++]
18+
version: [14, 15]
19+
include:
20+
- target: X86
21+
cc: gcc
22+
cpp: g++
23+
version: 12
1824

1925
steps:
2026
- if: matrix.cc == 'clang'
2127
run: |
22-
echo "cpp=clang++" >> $GITHUB_ENV
2328
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
24-
sudo touch /etc/apt/sources.list.d/llvm.list
25-
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
26-
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
27-
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
2829
sudo apt update
29-
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version}}
30-
31-
- if: matrix.cc == 'gcc' && matrix.version == '10'
32-
run: |
33-
echo "cpp=g++" >> $GITHUB_ENV
34-
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
35-
sudo apt install gcc-10 g++-10
30+
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version }}
3631
37-
- if: matrix.cc == 'gcc' && matrix.version == '11'
32+
- if: matrix.cc == 'gcc'
3833
run: |
39-
echo "cpp=g++" >> $GITHUB_ENV
4034
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
41-
sudo apt install gcc-11 g++-11
35+
sudo apt install gcc-${{ matrix.version }} g++-${{ matrix.version }}
4236
4337
- name: Check tools
4438
run: |
4539
git --version
4640
cmake --version
4741
make --version
4842
${{ matrix.cc }}-${{ matrix.version }} --version
49-
${{env.cpp}}-${{ matrix.version }} --version
43+
${{ matrix.cpp }}-${{ matrix.version }} --version
5044
5145
- name: Extract branch name
5246
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
@@ -66,7 +60,7 @@ jobs:
6660
-t ${{ matrix.target }} \
6761
-p /usr/local \
6862
-a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} \
69-
-b /usr/bin/${{env.cpp}}-${{ matrix.version }} \
63+
-b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} \
7064
-n $(nproc) \
7165
-x "-DLLVM_ENABLE_ASSERTIONS=ON" \
7266
-v

0 commit comments

Comments
 (0)