Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci build arm64 docker rel11 #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/Ubuntu20Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/London
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
curl \
gcc \
g++ \
make \
htop \
jq \
ninja-build \
tmux \
git \
wget \
patch \
python3-minimal \
python-is-python3 \
libdata-dumper-simple-perl \
unzip

RUN apt-get install -y software-properties-common && \
apt-get update && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get install -f -y gcc-9 g++-9 && \
apt-get install -f -y gcc-10 g++-10 && \
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list.d/llvm.list && \
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list.d/llvm.list && \
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-get update && \
apt-get install -f -y llvm-9 clang-9 && \
apt-get install -f -y llvm-10 clang-10 && \
apt-get install -f -y llvm-11 clang-11

RUN cd /opt && \
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.sh && \
/bin/sh cmake-3.20.0-linux-aarch64.sh --skip-license --include-subdir && \
ln -s /opt/cmake-3.20.0-linux-aarch64/bin/* /usr/local/bin

RUN ln -s /usr/bin/ninja-build /usr/local/bin/ninja

RUN mkdir /home/github/

RUN mkdir /home/root && cd home/root && \
git clone --depth 1 --single-branch --branch release_11x https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
cd classic-flang-llvm-project && \
mkdir -p build && cd build && \
cmake -DLLVM_TARGETS_TO_BUILD=AArch64 \
-DCMAKE_INSTALL_PREFIX=/home/github/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/bin/gcc-10 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DLLVM_ENABLE_PROJECTS="clang;openmp" \
-DLLVM_ENABLE_CLASSIC_FLANG=ON \
../llvm && \
make -j`nproc --ignore=1` && \
make install && \
make clean

RUN useradd github && \
chown -R github:github /home/github
USER github
58 changes: 58 additions & 0 deletions .github/workflows/build_push_docker_image_Ubuntu20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Ubuntu20 Dockerfile image

on:
push:
branches: [ release_11x, release_12x ]
paths-include:
- '**/.github/workflows/build_push_docker_image_Ubuntu20.yml'
- '**/.github/workflows/Ubuntu20Dockerfile.yml'

jobs:
docker:
runs-on: self-hosted
steps:
- name: Extract branch name
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
id: extract_branch

- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Log in
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
file: .github/workflows/Ubuntu20Dockerfile
push: true
context: .github/workflows
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: ghcr.io/${{ github.repository_owner }}/ubuntu20-flang-${{ steps.extract_branch.outputs.branch }}:latest
platforms: linux/arm64

# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
2 changes: 1 addition & 1 deletion .github/workflows/flang-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt update
sudo apt update -y
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version}}

- if: matrix.cc == 'gcc' && matrix.version == '10'
Expand Down