Add operator #538
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
name: tests | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
LLVM_VERSION: 16 | |
GCC_VERSION: 12 | |
jobs: | |
# format: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Install | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install clang-format-12 | |
# sudo ln -f /usr/bin/clang-format-12 /usr/bin/clang-format | |
# - name: Format | |
# run: | | |
# clang-format --version | |
# find src -name '*.cpp'|xargs clang-format --dry-run --Werror --style=file | |
# find src -name '*.h'|xargs clang-format --dry-run --Werror --style=file | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Clean up | |
continue-on-error: true | |
run: | | |
echo ">>>>" | |
apt list --installed | grep llvm | |
LLVM_PACKAGES=$(apt list --installed "*llvm*" 2>/dev/null |awk -F'/' 'NR>1{print $1}') | |
CLANG_PACKAGES=$(apt list --installed "*clang*" 2>/dev/null |awk -F'/' 'NR>1{print $1}') | |
sudo apt remove -y $LLVM_PACKAGES $CLANG_PACKAGES | |
sudo apt autoremove -y | |
echo "<<<<" | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Vulkan | |
run: | | |
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.243-jammy.list https://packages.lunarg.com/vulkan/1.3.243/lunarg-vulkan-1.3.243-jammy.list | |
sudo apt-get update | |
sudo apt-get install vulkan-sdk | |
- name: Install LLVM | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh ${LLVM_VERSION} | |
- name: Install Rest | |
run: | | |
sudo apt-get install -f -y "gcc-${GCC_VERSION}" "g++-${GCC_VERSION}" \ | |
"llvm-${LLVM_VERSION}-dev" "llvm-${LLVM_VERSION}-linker-tools" \ | |
"libclang-${LLVM_VERSION}-dev" "clang-${LLVM_VERSION}" \ | |
"clang-tidy-${LLVM_VERSION}" "libclang-cpp${LLVM_VERSION}-dev" \ | |
"libclang-cpp${LLVM_VERSION}" | |
sudo apt-get install -f -y zlib1g-dev | |
sudo ln -f "/usr/bin/clang-tidy-${LLVM_VERSION}" /usr/bin/clang-tidy | |
sudo ln -f "/usr/bin/llvm-symbolizer-${LLVM_VERSION}" /usr/bin/llvm-symbolizer | |
sudo ln -f "/usr/bin/gcov-${GCC_VERSION}" /usr/bin/gcov | |
pip install gcovr | |
mkdir -p build | |
- name: Configure | |
run: | | |
git submodule update --init | |
cd build | |
GCOV=gcov-${GCC_VERSION} CC=gcc-${GCC_VERSION} CXX=g++-${GCC_VERSION} cmake \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DBUILD_TESTING=ON \ | |
.. | |
- name: Compile | |
run: | | |
cd build | |
make -j $(nproc) | |
- name: Git Clone | |
if: always() && (github.ref == 'refs/heads/master') | |
run: | | |
git clone --single-branch --branch gh-pages https://${{ secrets.GH_TOKEN }}@github.com/Delaunay/lython.git build/coverage/ | |
git config --global user.email "Coverage" | |
git config --global user.name "Coverage Bot" | |
- name: Test | |
run: | | |
cd build | |
make coverage | |
cd coverage | |
python ../../scripts/parse_coverage.py --report coverage.xml --csv coverage.csv --template template/badge.svg --target badge.svg | |
- name: Upload coverage to Codecov | |
if: always() | |
uses: codecov/codecov-action@v3 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: always() && (github.ref == 'refs/heads/master') | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/coverage |