Skip to content

Commit 2e4fedd

Browse files
committed
[workflows] Minimal workflow to create an AArch64 container
AArch64 GitHub workflows require a Docker container named after the branch. This commit adds the minimal workflow required to create the container image for building and testing subsequent pull requests. Cherry-picking note: This commit also squashes parts of the following commits in order to modernize the tools in the Docker image. e698fc8 [workflows] Update GitHub actions to use modern tools 6aeab31 [workflows] Fix GitHub action bugs
1 parent 58df0ef commit 2e4fedd

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/workflows/UbuntuDockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ubuntu:22.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ENV TZ=Europe/London
5+
RUN apt-get update && \
6+
apt-get upgrade -y && \
7+
apt-get install -y \
8+
curl \
9+
gcc \
10+
g++ \
11+
make \
12+
htop \
13+
jq \
14+
ninja-build \
15+
tmux \
16+
git \
17+
wget \
18+
patch \
19+
python3-minimal \
20+
python-is-python3 \
21+
libdata-dumper-simple-perl \
22+
unzip
23+
24+
RUN apt-get install -y software-properties-common && \
25+
apt-get update && \
26+
add-apt-repository ppa:ubuntu-toolchain-r/test && \
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
30+
31+
# Install the tools for release_13x and newer
32+
RUN apt --fix-missing update && \
33+
apt install -y build-essential manpages-dev \
34+
libssl-dev zlib1g-dev \
35+
libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev && \
36+
apt install -y python3-distutils python3-psutil \
37+
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
38+
39+
RUN cd /opt && \
40+
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.sh && \
41+
/bin/sh cmake-3.20.0-linux-aarch64.sh --skip-license --include-subdir && \
42+
ln -s /opt/cmake-3.20.0-linux-aarch64/bin/* /usr/local/bin
43+
44+
RUN ln -s /usr/bin/ninja-build /usr/local/bin/ninja
45+
46+
RUN mkdir /home/github/
47+
48+
ARG BRANCH_NAME
49+
ARG INITIAL_BUILD
50+
RUN if [ "$INITIAL_BUILD" != "true" ]; then \
51+
mkdir /home/root && cd home/root && \
52+
git clone --depth 1 --single-branch --branch $BRANCH_NAME https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
53+
cd classic-flang-llvm-project && \
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 -v; \
55+
fi
56+
57+
RUN useradd github && \
58+
chown -R github:github /home/github
59+
USER github
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Pre-compile llvm ARM64
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
initialBuild:
7+
description: "True if creating an initial Docker image for this branch"
8+
required: true
9+
type: boolean
10+
push:
11+
branches:
12+
- 'release_*x'
13+
paths-include:
14+
- '**/.github/workflows/build_push_docker_image_Ubuntu.yml'
15+
- '**/.github/workflows/UbuntuDockerfile.yml'
16+
17+
jobs:
18+
docker:
19+
runs-on: self-hosted
20+
steps:
21+
- name: Extract branch name
22+
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
23+
id: extract_branch
24+
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v1
30+
31+
- name: Log in
32+
uses: docker/login-action@v1
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.repository_owner }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v2
40+
with:
41+
file: .github/workflows/UbuntuDockerfile
42+
push: true
43+
no-cache: true
44+
context: .github/workflows
45+
tags: ghcr.io/${{ github.repository_owner }}/ubuntu-flang-${{ steps.extract_branch.outputs.branch }}:latest
46+
platforms: linux/arm64
47+
build-args: |
48+
BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}
49+
INITIAL_BUILD=${{ inputs.initialBuild }}

0 commit comments

Comments
 (0)