Skip to content

Commit 51aed99

Browse files
kiranchandramohanbryanpkc
authored andcommitted
[workflows] Set up GitHub actions for Classic Flang
This commit squashes the following CI-related patches from the release_14x branch. commit 54a96d0 Author: Kiran Chandramohan <kiran.chandramohan@arm.com Date: Wed Oct 28 17:08:22 2020 +0000 [workflows] Removing a few CI pipelines commit 8bf9551 Author: Bryan Chan <bryan.chan@huawei.com> Date: Mon May 2 21:16:56 2022 -0400 [workflows] Stop using upstream actions and enable OpenMP build commit b921dd2 Author: michalpasztamobica <michal.paszta@mobica.com> Date: Fri Jun 4 13:55:52 2021 +0200 [workflows] Allow pre-compile jobs to be trigerred manually. commit 9f828fd Author: michalpasztamobica <michal.paszta@mobica.com> Date: Fri Jun 4 22:09:44 2021 +0200 [workflows] Add build scripts and make CI use them. commit a976b96 Author: Abraham Tovar <abraham.tovar@mobica.com> Date: Wed Oct 13 11:40:30 2021 +0200 [workflows] LLVM release_13x CI changes commit 7a5ee22 Author: Abraham Tovar <abraham.tovar@mobica.com> Date: Wed Nov 17 10:14:21 2021 +0000 [workflows] Removing CI test-base for release_100 commit a39a0c6 Author: pwisniewskimobica <przemyslaw.wisniewski@mobica.com> Date: Thu Jan 27 15:06:19 2022 +0100 [workflows] Use GCC 11 in CI builds commit 198a6b2 Author: pwisniewskimobica <przemyslaw.wisniewski@mobica.com> Date: Thu Jan 13 10:11:43 2022 +0100 [workflows] Modify CI scripts to add more test variants 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 commit b52bcc0 Author: Bryan Chan <bryanpkc@gmail.com> Date: Wed Jul 27 22:28:43 2022 -0400 [build] Stop caching AArch64 Docker image layers
1 parent 2e4fedd commit 51aed99

File tree

6 files changed

+279
-372
lines changed

6 files changed

+279
-372
lines changed

.github/workflows/flang-tests.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build and test Flang
2+
3+
on:
4+
pull_request:
5+
branches: [ release_11x, release_12x, release_13x, release_14x ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-20.04
10+
env:
11+
install_prefix: /usr/local
12+
strategy:
13+
matrix:
14+
target: [X86]
15+
cc: [clang]
16+
cpp: [clang++]
17+
version: [10, 11]
18+
include:
19+
- target: X86
20+
cc: gcc
21+
cpp: g++
22+
version: 10
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- if: matrix.cc == 'clang'
28+
run: |
29+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
30+
sudo touch /etc/apt/sources.list.d/llvm.list
31+
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
32+
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list
33+
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
34+
sudo apt update
35+
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version}}
36+
37+
- if: matrix.cc == 'gcc' && matrix.version == '10'
38+
run: |
39+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
40+
sudo apt install gcc-10 g++-10
41+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
42+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20
43+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10
44+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20
45+
46+
- name: ccache
47+
uses: hendrikmuhs/ccache-action@v1
48+
with:
49+
key: key-${{ matrix.cc }}-${{ matrix.version }}
50+
51+
- name: Check tools
52+
run: |
53+
git --version
54+
cmake --version
55+
make --version
56+
${{ matrix.cc }}-${{ matrix.version }} --version
57+
${{ matrix.cpp }}-${{ matrix.version }} --version
58+
59+
- name: Build and install llvm
60+
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
61+
62+
- name: Checkout flang
63+
run: |
64+
cd ../..
65+
git clone --depth 1 --single-branch --branch master https://github.com/flang-compiler/flang.git
66+
67+
- name: Build and install libpgmath & flang
68+
run: |
69+
cd ../../flang
70+
./build-flang.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -n $(nproc) -c -s
71+
72+
- name: Copy llvm-lit
73+
run: |
74+
cd ../../flang
75+
cp ../classic-flang-llvm-project/classic-flang-llvm-project/build/bin/llvm-lit build/bin/.
76+
77+
- name: Test flang
78+
run: |
79+
cd ../../flang/build
80+
make check-all

.github/workflows/libclang-abi-tests.yml

Lines changed: 0 additions & 171 deletions
This file was deleted.

.github/workflows/llvm-project-tests.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,17 @@ jobs:
6363
lit-tests:
6464
name: Lit Tests
6565
runs-on: ${{ matrix.os }}
66-
container:
67-
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
68-
volumes:
69-
- /mnt/:/mnt/
66+
env:
67+
install_prefix: /usr/local
7068
strategy:
7169
fail-fast: false
7270
matrix:
73-
os: ${{ fromJSON(inputs.os_list) }}
71+
target: [X86]
72+
os:
73+
- ubuntu-latest
74+
# We're using a specific version of macOS due to:
75+
# https://github.com/actions/virtual-environments/issues/5900
76+
- macOS-11
7477
steps:
7578
- name: Setup Windows
7679
if: startsWith(matrix.os, 'windows')
@@ -108,47 +111,19 @@ jobs:
108111
max-size: 2G
109112
key: ${{ matrix.os }}
110113
variant: sccache
111-
- name: Build and Test
114+
- name: Test clang macOS
115+
if: ${{ matrix.os == 'macOS-11'}}
112116
env:
113117
# Workaround for https://github.com/actions/virtual-environments/issues/5900.
114118
# This should be a no-op for non-mac OSes
115119
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
116-
shell: bash
117-
id: build-llvm
118120
run: |
119-
if [ "${{ runner.os }}" == "Linux" ]; then
120-
builddir="/mnt/build/"
121-
sudo mkdir -p $builddir
122-
sudo chown gha $builddir
123-
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
124-
else
125-
builddir="$(pwd)"/build
126-
fi
127-
if [ "${{ runner.os }}" == "macOS" ]; then
128-
# Workaround test failure on some lld tests on MacOS
129-
# https://github.com/llvm/llvm-project/issues/81967
130-
extra_cmake_args="-DLLVM_DISABLE_ASSEMBLY_FILES=ON"
131-
fi
132-
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT"
133-
cmake -G Ninja \
134-
-B "$builddir" \
135-
-S llvm \
136-
-DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" \
137-
-DCMAKE_BUILD_TYPE=Release \
138-
-DLLVM_ENABLE_ASSERTIONS=ON \
139-
-DLLDB_INCLUDE_TESTS=OFF \
140-
-DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" \
141-
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
142-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
143-
$extra_cmake_args \
144-
${{ inputs.extra_cmake_args }}
145-
ninja -C "$builddir" '${{ inputs.build_target }}'
146-
147-
- name: Build and Test libclc
148-
if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
149-
env:
150-
LLVM_BUILDDIR: ${{ steps.build-llvm.outputs.llvm-builddir }}
121+
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i -v
122+
cd build
123+
make check-all
124+
- name: Test clang ubuntu
125+
if: ${{ matrix.os == 'ubuntu-latest'}}
151126
run: |
152-
# The libclc tests don't have a generated check target so all we can
153-
# do is build it.
154-
ninja -C "$LLVM_BUILDDIR"
127+
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i -v
128+
cd build
129+
make check-all

0 commit comments

Comments
 (0)