forked from flang-compiler/flang
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable CI for master push and pull requests to master
Download and install the binaries for llvm and flang-driver. Then build openmp, libgpmath and flang and run tests. Triggerred on every push and pull request to master
- Loading branch information
1 parent
5755e10
commit a4a8b79
Showing
1 changed file
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Flang build & test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build_flang: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
target: [X86] # , AArch64, PowerPC] | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Download artifacts from llvm and flang-driver | ||
run: | | ||
cd ../.. | ||
wget --output-document artifacts_llvm `curl -sL https://api.github.com/repos/michalpasztamobica/llvm/actions/workflows/build_llvm.yml/runs | jq -r '.workflow_runs[0].artifacts_url?'` | ||
wget --output-document artifacts_flang-driver `curl -sL https://api.github.com/repos/michalpasztamobica/flang-driver/actions/workflows/build_flang-driver.yml/runs | jq -r '.workflow_runs[0].artifacts_url?'` | ||
wget --output-document artifacts_openmp `curl -sL https://api.github.com/repos/michalpasztamobica/flang/actions/workflows/build_dependencies.yml/runs | jq -r '.workflow_runs[0].artifacts_url?'` | ||
echo "cat artifacts_llvm" | ||
cat artifacts_llvm | ||
echo "cat artifacts_flang-driver" | ||
cat artifacts_flang-driver | ||
echo "cat artifacts_openmp" | ||
cat artifacts_openmp | ||
url=`jq -r '.artifacts[] | select(.name == "flang-driver_build_${{ matrix.target }}") | .archive_download_url' artifacts_flang-driver` | ||
wget --output-document flang-driver_build.zip --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $url | ||
|
||
url=`jq -r '.artifacts[] | select(.name == "llvm_build_${{ matrix.target }}") | .archive_download_url' artifacts_llvm` | ||
wget --output-document llvm_build.zip --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $url | ||
|
||
url=`jq -r '.artifacts[] | select(.name == "openmp_build_${{ matrix.target }}") | .archive_download_url' artifacts_openmp` | ||
wget --output-document openmp_build.zip --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $url | ||
|
||
- name: Install llvm | ||
run: | | ||
cd ../.. | ||
# Check out the repo, so the sources are in place. | ||
git clone --depth 1 --single-branch --branch release_90 https://github.com/flang-compiler/llvm.git | ||
# Don't build - use the prebuilt build directory | ||
unzip llvm_build.zip | ||
tar xvzf llvm_build.tar.gz | ||
mv build llvm/. | ||
cd llvm/build | ||
sudo make install/fast | ||
echo "llvm-config --version" | ||
llvm-config --version | ||
- name: Install flang-driver | ||
run: | | ||
cd ../.. | ||
# Check out the repo, so the sources are in place. | ||
git clone --depth 1 --single-branch --branch release_90 https://github.com/flang-compiler/flang-driver.git | ||
# Don't build - use the prebuilt build directory | ||
unzip flang-driver_build.zip | ||
tar xvzf flang-driver_build.tar.gz | ||
mv build flang-driver/. | ||
cd flang-driver/build | ||
sudo make install/fast | ||
flang --version | ||
echo "llvm-config --version" | ||
llvm-config --version | ||
- name: Build OpenMP | ||
run: | | ||
cd ../.. | ||
CMAKE_OPTIONS="-DLLVM_TARGETS_TO_BUILD=${{ matrix.target }}" | ||
git clone --depth 1 --single-branch --branch release_90 https://github.com/llvm-mirror/openmp.git | ||
cd openmp | ||
mkdir -p build && cd build | ||
cmake $CMAKE_OPTIONS -DCMAKE_C_COMPILER=/usr/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 .. | ||
make -j$(nproc) | ||
sudo make install | ||
- name: Build libpgmath | ||
run: | | ||
CMAKE_OPTIONS="-DLLVM_TARGETS_TO_BUILD=${{ matrix.target }}" | ||
cd runtime/libpgmath | ||
mkdir -p build && cd build | ||
cmake $CMAKE_OPTIONS -DCMAKE_C_COMPILER=/usr/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 .. | ||
make -j$(nproc) | ||
sudo make install | ||
- name: Build Flang | ||
run: | | ||
CMAKE_OPTIONS="-DLLVM_TARGETS_TO_BUILD=${{ matrix.target }}" | ||
mkdir -p build && cd build | ||
cmake $CMAKE_OPTIONS \ | ||
-DCMAKE_C_COMPILER=/usr/bin/gcc-9 \ | ||
-DCMAKE_CXX_COMPILER=/usr/bin/g++-9 \ | ||
-DCMAKE_Fortran_COMPILER=/usr/local/bin/flang .. | ||
make -j$(nproc) | ||
sudo make install | ||
- name: Test flang | ||
run: | | ||
CMAKE_OPTIONS="-DLLVM_TARGETS_TO_BUILD=${{ matrix.target }}" | ||
cp llvm/build/bin/llvm-lit build/bin/. | ||
cd build | ||
make check-all | ||