CI #152
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
env: | |
boost_ver1: "1_86_0" | |
boost_ver2: "1.86.0" | |
ispc_ver: "1.25.1" | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ $default-branch ] | |
pull_request: | |
branches: [ $default-branch ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
download_boost: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Make temp dir | |
run: | | |
mkdir tmp | |
mkdir ~/dependency | |
cd ~/dependency | |
mkdir include | |
- name: Check boost library | |
id: check-boost | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/dependency/include/boost | |
key: cache-boost-${{ env.boost_ver1 }} | |
lookup-only: true | |
- name: Download boost library | |
if: ${{steps.check-boost.outputs.cache-hit != 'true'}} | |
working-directory: ./tmp | |
run: | | |
wget --no-show-progress -O boost.tar.bz2 https://archives.boost.io/release/${{env.boost_ver2}}/source/boost_${{env.boost_ver1}}.tar.bz2 | |
tar xjf boost.tar.bz2 | |
mv ./boost_${{env.boost_ver1}}/boost ~/dependency/include/ | |
- name: Cache boost library | |
id: save-boost | |
if: ${{steps.check-boost.outputs.cache-hit != 'true'}} | |
uses: actions/cache/save@v4 | |
with: | |
path: ~/dependency/include/boost | |
key: cache-boost-${{ env.boost_ver1 }} | |
download_ispc: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Make temp dir | |
run: | | |
mkdir tmp | |
mkdir ~/dependency | |
cd ~/dependency | |
mkdir bin | |
- name: Check ispc | |
id: check-ispc | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/dependency/bin/ispc | |
key: cache-ispc-${{ env.ispc_ver }} | |
lookup-only: true | |
- name: Download ispc | |
if: ${{steps.check-ispc.outputs.cache-hit != 'true'}} | |
working-directory: ./tmp | |
run: | | |
wget --no-show-progress -O ispc.tar.gz https://github.com/ispc/ispc/releases/download/v${{env.ispc_ver}}/ispc-v${{env.ispc_ver}}-linux.tar.gz | |
mkdir ispc | |
tar xzf ispc.tar.gz -C ./ispc | |
mv ./ispc ~/dependency/bin/ | |
- name: Cache ispc | |
id: save-ispc | |
if: ${{steps.check-ispc.outputs.cache-hit != 'true'}} | |
uses: actions/cache/save@v4 | |
with: | |
path: ~/dependency/bin/ispc | |
key: cache-ispc-${{ env.ispc_ver }} | |
clone_repo: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Cache repo | |
id: cache-repo | |
uses: actions/cache@v4 | |
with: | |
path: . | |
key: cache-repo-${{ github.sha }} | |
lookup-only: true | |
- name: Clone repo | |
#if: ${{steps.cache-repo.outputs.cache-hit != 'true'}} | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
build: | |
needs: [download_boost, download_ispc, clone_repo] | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
cxx: [gcc9, gcc10, gcc11, gcc12, gcc13, gcc14, clang10, clang11, clang12, clang13, clang14, clang15, clang16] | |
include: | |
- cxx: gcc9 | |
os: ubuntu-22.04 | |
env_cc: "gcc-9" | |
env_asm: "g++-9" | |
env_cpp: "g++-9" | |
env_stalink: "gcc-ar-9" | |
env_dynlink: "g++-9" | |
env_applink: "g++-9" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-9" | |
- cxx: gcc10 | |
os: ubuntu-22.04 | |
env_cc: "gcc-10" | |
env_asm: "g++-10" | |
env_cpp: "g++-10" | |
env_stalink: "gcc-ar-10" | |
env_dynlink: "g++-10" | |
env_applink: "g++-10" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-10" | |
- cxx: gcc11 | |
os: ubuntu-22.04 | |
env_cc: "gcc-11" | |
env_asm: "g++-11" | |
env_cpp: "g++-11" | |
env_stalink: "gcc-ar-11" | |
env_dynlink: "g++-11" | |
env_applink: "g++-11" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-11" | |
- cxx: gcc12 | |
os: ubuntu-22.04 | |
env_cc: "gcc-12" | |
env_asm: "g++-12" | |
env_cpp: "g++-12" | |
env_stalink: "gcc-ar-12" | |
env_dynlink: "g++-12" | |
env_applink: "g++-12" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-12" | |
- cxx: gcc13 | |
os: ubuntu-22.04 | |
env_cc: "gcc-13" | |
env_asm: "g++-13" | |
env_cpp: "g++-13" | |
env_stalink: "gcc-ar-13" | |
env_dynlink: "g++-13" | |
env_applink: "g++-13" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-13" | |
- cxx: gcc14 | |
os: ubuntu-24.04 | |
env_cc: "gcc-14" | |
env_asm: "g++-14" | |
env_cpp: "g++-14" | |
env_stalink: "gcc-ar-14" | |
env_dynlink: "g++-14" | |
env_applink: "g++-14" | |
env_module: "all" | |
env_clang: false | |
pkg: "g++-14" | |
- cxx: clang10 | |
os: ubuntu-20.04 | |
env_cc: "clang-10" | |
env_asm: "clang++-10" | |
env_cpp: "clang++-10" | |
env_stalink: "llvm-ar-10" | |
env_dynlink: "clang++-10" | |
env_applink: "clang++-10" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 10 | |
pkg: "clang-10 lld-10 llvm-10" | |
- cxx: clang11 | |
os: ubuntu-20.04 | |
env_cc: "clang-11" | |
env_asm: "clang++-11" | |
env_cpp: "clang++-11" | |
env_stalink: "llvm-ar-11" | |
env_dynlink: "clang++-11" | |
env_applink: "clang++-11" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 11 | |
pkg: "clang-11 lld-11 llvm-11" | |
- cxx: clang12 | |
os: ubuntu-20.04 | |
env_cc: "clang-12" | |
env_asm: "clang++-12" | |
env_cpp: "clang++-12" | |
env_stalink: "llvm-ar-12" | |
env_dynlink: "clang++-12" | |
env_applink: "clang++-12" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 12 | |
pkg: "clang-12 lld-12 llvm-12" | |
- cxx: clang13 | |
os: ubuntu-22.04 | |
env_cc: "clang-13" | |
env_asm: "clang++-13" | |
env_cpp: "clang++-13" | |
env_stalink: "llvm-ar-13" | |
env_dynlink: "clang++-13" | |
env_applink: "clang++-13" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 13 | |
pkg: "clang-13 lld-13 llvm-13" | |
- cxx: clang14 | |
os: ubuntu-22.04 | |
env_cc: "clang-14" | |
env_asm: "clang++-14" | |
env_cpp: "clang++-14" | |
env_stalink: "llvm-ar-14" | |
env_dynlink: "clang++-14" | |
env_applink: "clang++-14" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 14 | |
pkg: "clang-14 lld-14 llvm-14" | |
- cxx: clang15 | |
os: ubuntu-22.04 | |
env_cc: "clang-15" | |
env_asm: "clang++-15" | |
env_cpp: "clang++-15" | |
env_stalink: "llvm-ar-15" | |
env_dynlink: "clang++-15" | |
env_applink: "clang++-15" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 15 | |
pkg: "clang-15 lld-15 llvm-15" | |
- cxx: clang16 | |
os: ubuntu-24.04 | |
env_cc: "clang-16" | |
env_asm: "clang++-16" | |
env_cpp: "clang++-16" | |
env_stalink: "llvm-ar-16" | |
env_dynlink: "clang++-16" | |
env_applink: "clang++-16" | |
env_module: "all" | |
env_clang: true | |
env_clang_ver: 16 | |
pkg: "clang-16 lld-16 llvm-16" | |
steps: | |
- name: Get basic information | |
run: | | |
echo "run_id=${{github.run_id}}" | |
echo "sha=${{github.sha}}" | |
echo "workspace=${{github.workspace}}" | |
echo $GITHUB_WORKSPACE | |
echo ~ | |
echo $HOME | |
pwd | |
- name: Make temp dir | |
run: | | |
echo "ubt_codename=$(lsb_release -c -s)" >> $GITHUB_ENV | |
echo "ubt_release=$(lsb_release -r -s)" >> $GITHUB_ENV | |
mkdir tmp | |
mkdir ~/dependency | |
cd ~/dependency | |
mkdir include | |
mkdir bin | |
echo "CPP_DEPENDENCY_PATH=$(pwd)" >> $GITHUB_ENV | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
#- uses: actions/checkout@v4 | |
# with: | |
# submodules: "true" | |
- name: Retrieve repo | |
id: retrieve-repo | |
uses: actions/cache/restore@v4 | |
with: | |
path: . | |
key: cache-repo-${{ github.sha }} | |
fail-on-cache-miss: true | |
- name: Retrieve boost library | |
id: retrieve-boost | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/dependency/include/boost | |
key: cache-boost-${{ env.boost_ver1 }} | |
fail-on-cache-miss: true | |
- name: Retrieve ispc | |
id: retrieve-ispc | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/dependency/bin/ispc | |
key: cache-ispc-${{ env.ispc_ver }} | |
fail-on-cache-miss: true | |
# - name: Prepare for clang | |
# if: ${{matrix.env_clang}} | |
# working-directory: ./tmp | |
# run: | | |
# wget --no-show-progress -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add - | |
# CLANG_REPO="deb http://apt.llvm.org/$(lsb_release -c -s)/ llvm-toolchain-$(lsb_release -c -s)-${{matrix.env_clang_ver}} main" | |
# echo $CLANG_REPO | |
# sudo add-apt-repository "$CLANG_REPO" -y | |
- name: Install packages | |
run: | | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
sudo apt update -q | |
[[ $(echo "$ubt_release >= 19.10" | bc -l) = 0 ]] && lrlver="7" || lrlver="8" | |
sudo apt install util-linux nasm unzip python3 python3-pip python3-chardet ${{matrix.pkg}} | |
sudo apt install libreadline$lrlver libreadline-dev libx11-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxxf86vm-dev libdrm-dev | |
- name: Setup environment | |
id: setup | |
run: | | |
echo $CPP_DEPENDENCY_PATH | |
echo "ISPCCOMPILER=$(find ~/dependency/bin -type f -name ispc)" >> $GITHUB_ENV | |
echo $ISPCCOMPILER | |
echo "CCOMPILER=${{matrix.env_cc}}" >> $GITHUB_ENV | |
echo "ASMCOMPILER=${{matrix.env_asm}}" >> $GITHUB_ENV | |
echo "CPPCOMPILER=${{matrix.env_cpp}}" >> $GITHUB_ENV | |
echo "STATICLINKER=${{matrix.env_stalink}}" >> $GITHUB_ENV | |
echo "DYNAMICLINKER=${{matrix.env_dynlink}}" >> $GITHUB_ENV | |
echo "APPLINKER=${{matrix.env_applink}}" >> $GITHUB_ENV | |
echo "perfhost=ci" >> $GITHUB_ENV | |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: List verbose info | |
run: | | |
$ISPCCOMPILER --version | |
$CPPCOMPILER --version | |
python3 --version | |
nasm -v | |
lscpu | |
- name: Build Debug modules | |
run: | | |
python3 xzbuild rebuild "${{matrix.env_module}},-curl,-libressl,-BasicsTest,-SystemCommonTest,-NailangTest,-NullTest,-Blur" /threads=x2 /dsymlv=0 | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: debug-${{matrix.cxx}}-${{steps.setup.outputs.date}}-${{github.run_id}} | |
path: x64/Debug | |
retention-days: 7 | |
- name: Build Release modules | |
run: | | |
python3 xzbuild rebuildall "BasicsTest,SystemCommonTest,ImageUtilTest,NailangTest" Release /threads=x1.5 /dsymlv=0 | |
- name: Run Tests | |
run: | | |
./x64/Release/BasicsTest | |
./x64/Release/SystemCommonTest -perfreport | |
./x64/Release/ImageUtilTest -perfreport | |
./x64/Release/NailangTest | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: release-${{matrix.cxx}}-${{steps.setup.outputs.date}}-${{github.run_id}} | |
path: x64/Release | |
retention-days: 7 |