Skip to content

Commit

Permalink
add basic build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Oct 1, 2024
0 parents commit cecc858
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on:
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- runs-on: ubuntu-22.04
os: linux
arch: x86_64
- runs-on: macos-14
os: macos
arch: arm64
- runs-on: macos-13
os: macos
arch: x86_64
runs-on: ${{ matrix.config.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: llvm/llvm-project
path: llvm-project
- name: Install dependencies
run: ./scripts/install-${{ matrix.config.os }}.sh
- name: Build clang-format
run: ./scripts/build-${{ matrix.config.os }}.sh
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: clang-format-${{ matrix.config.os }}-${{ matrix.config.arch }}
path: llvm-project/build/bin/clang-format
9 changes: 9 additions & 0 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_BUILD_STATIC=true -DLLVM_ENABLE_PROJECTS=clang ../llvm
ninja clang-format
strip bin/clang-format
9 changes: 9 additions & 0 deletions scripts/build-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_PROJECTS=clang ../llvm
ninja clang-format
strip bin/clang-format
6 changes: 6 additions & 0 deletions scripts/install-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

sudo apt-get update
sudo apt-get install -y ninja-build
5 changes: 5 additions & 0 deletions scripts/install-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

brew install ninja

0 comments on commit cecc858

Please sign in to comment.