Skip to content

Adding issue template #23

Adding issue template

Adding issue template #23

Workflow file for this run

name: Flang build & test
on:
push:
branches: [ master ]
paths-ignore:
- '**/.github/workflows/build_flang_arm64.yml'
pull_request:
branches: [ master ]
paths-ignore:
- '**/.github/workflows/build_flang_arm64.yml'
jobs:
build_flang:
runs-on: ubuntu-20.04
env:
install_prefix: /usr/local
strategy:
matrix:
target: [X86]
cc: [clang]
cpp: [clang++]
version: [10, 11]
llvm_branch: [release_100, release_11x, release_12x]
include:
- target: X86
cc: gcc
cpp: g++
version: 10
llvm_branch: release_100
- target: X86
cc: gcc
cpp: g++
version: 10
llvm_branch: release_11x
- target: X86
cc: gcc
cpp: g++
version: 10
llvm_branch: release_12x
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.cc }}-${{ matrix.version }}
- name: Check tools
run: |
sudo apt update
sudo apt install python3-sphinx
git --version
cmake --version
make --version
# Download artifacts for the classic-flang-llvm-project-related builds (all toolchains)
- name: Download artifacts
run: |
cd ../..
curl -sL https://api.github.com/repos/flang-compiler/classic-flang-llvm-project/actions/workflows/pre-compile_llvm.yml/runs --output runs_llvm.json
wget --output-document artifacts_llvm `jq -r '.workflow_runs[0].artifacts_url?' runs_llvm.json`
i="0"
# Keep checking older builds to find the right branch and correct number of artifacts
while { [ `jq -r '.total_count?' artifacts_llvm` != "3" ] || \
[ `jq -r --argjson i "$i" '.workflow_runs[$i].head_branch?' runs_llvm.json` != ${{ matrix.llvm_branch }} ]; } && \
[ $i -lt 10 ];
do
echo "No artifacts or wrong branch in build $i, counting from latest"
i=$[$i+1]
wget --output-document artifacts_llvm `jq -r --argjson i "$i" '.workflow_runs[$i].artifacts_url?' runs_llvm.json`
done
url=`jq -r '.artifacts[] | select(.name == "llvm_build_${{ matrix.target }}_${{ matrix.cc }}_${{ matrix.version }}_${{ matrix.llvm_branch }}") | .archive_download_url' artifacts_llvm`
wget --output-document llvm_build.zip --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $url
- name: Install llvm
run: |
cd ../..
# Don't clone nor build - use the prepackaged sources and prebuilt build directory
unzip llvm_build.zip
tar xzf llvm_build.tar.gz
cd classic-flang-llvm-project/build
sudo make install/fast
- name: Build and install flang & libpgmath
run: ./build-flang.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -n $(nproc) -c -s
- name: Copy llvm-lit
run: |
cp ../../classic-flang-llvm-project/build/bin/llvm-lit build/bin/.
- name: Test flang
run: |
cd build
make check-all
# Archive documentation just once, for the fastest job.
- if: matrix.cc == 'clang' && matrix.version == '11'
run: |
cd build/docs/web
cp -r html/ ../../.. # copy to a place where Upload can find it.
# Upload docs just once, for the fastest job.
- if: matrix.cc == 'clang' && matrix.version == '11'
uses: actions/upload-artifact@v2
with:
name: html_docs_flang
path: html