-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: github actions for building (#1)
- Loading branch information
Showing
8 changed files
with
295 additions
and
156 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
UseTab: Always | ||
IndentWidth: 4 | ||
TabWidth: 4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 4 | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[*.{sh,cmd}] | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
indent_style = space |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: main | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
# libcxx version to match whats already installed | ||
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md | ||
LLVM_VERSION: '18.1.3' | ||
|
||
jobs: | ||
typos-check: | ||
name: Typos Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: crate-ci/typos@cfe759ac8dd421e203cc293a373396fbc6fe0d4b # v1.22.7 | ||
|
||
build-script-windows: | ||
name: 'build.cmd' | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: .\build.cmd | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cpp2b.exe | ||
path: dist/debug/cpp2b.exe | ||
if-no-files-found: error | ||
retention-days: 0 | ||
|
||
build-self-windows: | ||
name: 'build self (windows)' | ||
needs: build-script-windows | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: 'cpp2b.exe' | ||
- run: .\cpp2b.exe build | ||
- run: Copy-Item .\.cache\cpp2\bin\cpp2b.exe -Destination .\cpp2b-self.exe | ||
- run: .\cpp2b-self.exe build | ||
|
||
build-script-linux: | ||
name: 'build.sh' | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- run: sudo apt-get install libclang-dev ninja-build -y | ||
- uses: actions/cache@v4 | ||
id: libcxx_with_modules | ||
with: | ||
path: /tmp/llvm-project/build | ||
key: 'libcxx-${{ env.LLVM_VERSION }}' | ||
- name: compiling libcxx ${{ env.LLVM_VERSION }} with modules | ||
if: steps.libcxx_with_modules.outputs.cache-hit != 'true' | ||
run: | | ||
git clone --depth 1 --branch llvmorg-${{ env.LLVM_VERSION }} https://github.com/llvm/llvm-project.git /tmp/llvm-project | ||
cd /tmp/llvm-project | ||
mkdir build | ||
CC=clang-18 CXX=clang++-18 cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" | ||
ninja -C build | ||
- uses: actions/checkout@v4 | ||
- run: CPP2B_LIBCXX_BUILD_ROOT=/tmp/llvm-project/build CC=clang-18 ./build.sh | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cpp2b | ||
path: dist/debug/cpp2b | ||
if-no-files-found: error | ||
retention-days: 0 | ||
|
||
build-self-linux: | ||
name: 'build self (linux)' | ||
needs: build-script-linux | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/cache/restore@v4 | ||
with: | ||
path: /tmp/llvm-project/build | ||
key: 'libcxx-${{ env.LLVM_VERSION }}' | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: cpp2b | ||
- run: chmod +x cpp2b | ||
- run: CPP2B_LIBCXX_BUILD_ROOT=/tmp/llvm-project/build ./cpp2b build | ||
- run: CPP2B_LIBCXX_BUILD_ROOT=/tmp/llvm-project/build ./.cache/cpp2/bin/cpp2b build |
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
Oops, something went wrong.