hyprlang/.github/workflows/arch.yml

72 lines
2.8 KiB
YAML
Raw Normal View History

2023-12-29 16:15:23 +01:00
name: Build & Test (Arch)
on: [push, pull_request, workflow_dispatch]
jobs:
gcc:
name: "gcc build / clang test"
runs-on: ubuntu-latest
container:
image: archlinux
steps:
- name: Checkout repository actions
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
2023-12-29 16:46:55 +01:00
- name: Get required pkgs
2023-12-29 16:15:23 +01:00
run: |
sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf
pacman --noconfirm --noprogressbar -Syyu
pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang
- name: Build with gcc
run: |
2023-12-29 16:20:10 +01:00
CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
2023-12-29 16:15:23 +01:00
cp ./build/libhyprlang.so /usr/lib
- name: Build with clang
run: |
rm -rf ./build
2023-12-29 16:23:51 +01:00
CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
2023-12-29 16:46:55 +01:00
rm ./build/libhyprlang.so
2023-12-29 16:15:23 +01:00
- name: Run tests
run: |
2023-12-29 16:28:22 +01:00
cd ./tests && ../build/hyprlang_test
2023-12-29 16:15:23 +01:00
2023-12-29 16:18:14 +01:00
clang:
name: "clang build / gcc test"
2023-12-29 16:15:23 +01:00
runs-on: ubuntu-latest
container:
image: archlinux
steps:
- name: Checkout repository actions
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
2023-12-29 16:46:55 +01:00
- name: Get required pkgs
2023-12-29 16:15:23 +01:00
run: |
sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf
pacman --noconfirm --noprogressbar -Syyu
pacman --noconfirm --noprogressbar -Sy gcc base-devel cmake clang
2023-12-29 16:26:03 +01:00
- name: Build with clang
2023-12-29 16:15:23 +01:00
run: |
2023-12-29 16:23:51 +01:00
CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
CC="/usr/bin/clang" CXX="/usr/bin/clang++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
2023-12-29 16:15:23 +01:00
cp ./build/libhyprlang.so /usr/lib
2023-12-29 16:26:03 +01:00
- name: Build with gcc
2023-12-29 16:15:23 +01:00
run: |
rm -rf ./build
2023-12-29 16:20:10 +01:00
CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
CC="/usr/bin/gcc" CXX="/usr/bin/g++" cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
2023-12-29 16:46:55 +01:00
rm ./build/libhyprlang.so
2023-12-29 16:15:23 +01:00
- name: Run tests
run: |
2023-12-29 16:28:22 +01:00
cd ./tests && ../build/hyprlang_test