Skip to content

Commit

Permalink
[workflows] Set up GitHub actions for release_14x branch
Browse files Browse the repository at this point in the history
This commit squashes the following commits from the release_14x branch:

    commit 84ed34d
    Author: Bryan Chan <bryan.chan@huawei.com>
    Date:   Sun Apr 24 19:13:25 2022 -0400

        [workflows] support GitHub actions for release_14x branch

    commit dd852a6
    Author: Bryan Chan <bryanpkc@gmail.com>
    Date:   Fri Jul 15 21:50:21 2022 -0400

        [workflows] Fix CI for release_14x

        1. Parameterize Ubuntu20Dockerfile with the branch name. Previously the
           Dockerfile was still creating container images from the hardcoded
           release_13x branch.

        2. Update the workaround for MacOS X build failures according to
           actions/runner-images#2274.

        3. For debugging purpose, add a -v option to build-llvm-project.sh to enable
           verbose output. The option sets $VERBOSE to an non-empty string which
           forces the CMake-generated Makefile to print every command it runs.

        4. Delete the repo-lockdown workflow to eliminate the job which is always
           a no-op for classic-flang-llvm-project.
  • Loading branch information
bryanpkc committed Sep 7, 2022
1 parent 3383daf commit 5ea6dde
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 31 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/Ubuntu20Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get install -y software-properties-common && \
apt-get install -f -y llvm-10 clang-10 && \
apt-get install -f -y llvm-11 clang-11

# Install the tools for release_13x
# Install the tools for release_13x and newer
RUN apt --fix-missing update && \
apt install -y build-essential manpages-dev \
libssl-dev zlib1g-dev \
Expand All @@ -51,10 +51,11 @@ RUN ln -s /usr/bin/ninja-build /usr/local/bin/ninja

RUN mkdir /home/github/

ARG BRANCH_NAME
RUN mkdir /home/root && cd home/root && \
git clone --depth 1 --single-branch --branch release_13x https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
git clone --depth 1 --single-branch --branch $BRANCH_NAME https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
cd classic-flang-llvm-project && \
./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
./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 -v

RUN useradd github && \
chown -R github:github /home/github
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build_push_docker_image_Ubuntu20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pre-compile llvm ARM64
on:
workflow_dispatch:
push:
branches: [ release_11x, release_12x, release_13x ]
branches: [ release_11x, release_12x, release_13x, release_14x ]
paths-include:
- '**/.github/workflows/build_push_docker_image_Ubuntu20.yml'
- '**/.github/workflows/Ubuntu20Dockerfile.yml'
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
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
build-args: |
BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}
# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flang-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and test Flang

on:
pull_request:
branches: [ release_11x, release_12x, release_13x ]
branches: [ release_11x, release_12x, release_13x, release_14x ]

jobs:
build:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
${{ matrix.cpp }}-${{ matrix.version }} --version
- name: Build and install llvm
run: ./build-llvm-project.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} -n $(nproc) -c -i -s
run: ./build-llvm-project.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} -n $(nproc) -c -i -s -v

- name: Checkout flang
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ jobs:
# This should be a no-op for non-mac OSes
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
run: |
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i -v
cd build
make check-all
- name: Test clang ubuntu
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i -v
cd build
make check-all
5 changes: 3 additions & 2 deletions .github/workflows/pre-compile_llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pre-compile llvm
on:
workflow_dispatch:
push:
branches: [ release_100, release_11x, release_12x, release_13x ]
branches: [ release_11x, release_12x, release_13x, release_14x ]

jobs:
build:
Expand Down Expand Up @@ -65,7 +65,8 @@ jobs:
-p /usr/local \
-a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} \
-b /usr/bin/${{env.cpp}}-${{ matrix.version }} \
-n $(nproc)
-n $(nproc) \
-v
# Archive the source + build directories for future installation
cd ..
tar -zcf llvm_build.tar.gz classic-flang-llvm-project
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/repo-lockdown.yml

This file was deleted.

11 changes: 9 additions & 2 deletions build-llvm-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ USE_SUDO="0"
C_COMPILER_PATH="/usr/bin/gcc"
CXX_COMPILER_PATH="/usr/bin/g++"
LLVM_ENABLE_PROJECTS="clang;openmp"
VERBOSE=""

set -e # Exit script on first error.

Expand All @@ -36,8 +37,9 @@ function print_usage {
echo " -a C compiler path. Default: /usr/bin/gcc";
echo " -b C++ compiler path. Default: /usr/bin/g++";
echo " -e List of the LLVM sub-projects to build. Default: clang;openmp";
echo " -v Enable verbose output";
}
while getopts "t:d:p:n:c?i?s?a:b:e:" opt; do
while getopts "t:d:p:n:c?i?s?a:b:e:v" opt; do
case "$opt" in
t) TARGET=$OPTARG;;
d) BUILD_TYPE=$OPTARG;;
Expand All @@ -49,6 +51,7 @@ while getopts "t:d:p:n:c?i?s?a:b:e:" opt; do
a) C_COMPILER_PATH=$OPTARG;;
b) CXX_COMPILER_PATH=$OPTARG;;
e) LLVM_ENABLE_PROJECTS=$OPTARG;;
v) VERBOSE="1";;
?) print_usage; exit 0;;
esac
done
Expand All @@ -72,8 +75,12 @@ fi

# Build and install
mkdir -p build && cd build
if [ -n "$VERBOSE" ]; then
set -x
fi
cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS=$LLVM_ENABLE_PROJECTS ../llvm
make -j$NPROC
set +x
make -j$NPROC VERBOSE=$VERBOSE
if [ $DO_INSTALL == "1" ]; then
if [ $USE_SUDO == "1" ]; then
echo "Install with sudo"
Expand Down

0 comments on commit 5ea6dde

Please sign in to comment.