Skip to content

Commit

Permalink
Merge pull request #51 from tenko/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
zaskar9 authored May 11, 2024
2 parents a775e83 + b6481d4 commit 21ec821
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Linux CI Build

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch :

env:
build_type: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install packages
run: |
sudo apt-get update &&
sudo apt-get install libboost-all-dev libboost-filesystem-dev python3-pip
- name: Install Clang 17
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17 all
- name: Install lit & filecheck
run: |
sudo pip3 install lit
sudo pip3 install filecheck
- name: Configure CMake
run: >
cmake -B ${{ github.workspace }}/build -S ${{ github.workspace }}
-DLLVM_ROOT=/usr/lib/llvm-17
-DBoost_NO_BOOST_CMAKE=ON
-DCMAKE_CXX_COMPILER=clang++-17
-DCMAKE_C_COMPILER=clang-17
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }}

- name: Install
run: cmake --install ${{ github.workspace }}/build --prefix install

- name: Test
run: cd ${{ github.workspace }}/build && make test >test_report_linux.txt || true

- name: Upload build
uses: actions/upload-artifact@v4
with:
name: binary-linux-release
path: ${{ github.workspace }}/install/**/*

- name: Upload report
uses: actions/upload-artifact@v4
with:
name: test_report_msys2.txt
path: ${{ github.workspace }}/build/test_report_linux.txt

60 changes: 60 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: MacOS CI Build

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch:

env:
build_type: Release

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Install packages
run: |
brew install git &&
brew install make &&
brew install cmake &&
brew install llvm@17 &&
brew install boost &&
brew install python
- name: Install lit & filecheck
run: |
pip install lit &&
pip install filecheck
- name: Configure CMake
run: >
cmake -B ${{ github.workspace }}/build -S ${{ github.workspace }} -G "Unix Makefiles"
-DLLVM_DIR=/opt/homebrew/opt/llvm@17/lib/cmake/llvm/
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@17/bin/clang++
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@17/bin/clang
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }}

- name: Install
run: cmake --install ${{ github.workspace }}/build --prefix install

- name: Test
run: cd ${{ github.workspace }}/build && make test >test_report_macos.txt

- name: Upload build
uses: actions/upload-artifact@v4
with:
name: binary-macos-release
path: ${{ github.workspace }}/install/**/*

- name: Upload report
uses: actions/upload-artifact@v4
with:
name: test_report_macos.txt
path: ${{ github.workspace }}/build/test_report_macos.txt
64 changes: 64 additions & 0 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: MSYS2 CI Build

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch:

env:
build_type: Release

jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true

- name: Install packages
run: |
pacman --noconfirm -S git &&
pacman --noconfirm -S make &&
pacman --noconfirm -S mingw-w64-clang-x86_64-python-pip &&
pacman --noconfirm -S mingw-w64-clang-x86_64-toolchain &&
pacman --noconfirm -S mingw-w64-clang-x86_64-boost &&
pacman --noconfirm -S mingw-w64-clang-x86_64-cmake
- name: Install lit & filecheck
run: |
pip3 install lit &&
pip3 install filecheck
- name: Configure CMake
run: >
cmake -B "$GITHUB_WORKSPACE"/build
-S "$GITHUB_WORKSPACE" -G "MSYS Makefiles"
- name: Build
run: cmake --build "$GITHUB_WORKSPACE"/build --config ${{ env.build_type }}

- name: Install
run: cmake --install "$GITHUB_WORKSPACE"/build --prefix install

- name: Test
run: cd "$GITHUB_WORKSPACE"/build && make test >test_report_msys2.txt

- name: Upload build
uses: actions/upload-artifact@v4
with:
name: binary-msys2-release
path: ${{ github.workspace }}/install/**/*

- name: Upload report
uses: actions/upload-artifact@v4
with:
name: test_report_msys2.txt
path: ${{ github.workspace }}/build/test_report_msys2.txt

0 comments on commit 21ec821

Please sign in to comment.