Develop #66
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: Windows-LLVM | |
on: | |
pull_request: | |
branches: [main, develop] | |
paths-ignore: | |
- '.github/workflows/Windows-MSVC.yml' | |
- '.github/workflows/Linux.yml' | |
- '.github/workflows/macOS.yml' | |
- '.github/workflows/iOS.yml' | |
- '.github/workflows/Android.yml' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'README.md' | |
push: | |
branches: [develop] | |
paths-ignore: | |
- '.github/workflows/Windows-MSVC.yml' | |
- '.github/workflows/Linux.yml' | |
- '.github/workflows/macOS.yml' | |
- '.github/workflows/iOS.yml' | |
- '.github/workflows/Android.yml' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'README.md' | |
jobs: | |
build: | |
name: ${{ matrix.os }}-LLVM-${{ matrix.arch }} ( ${{ matrix.kind }}-${{ matrix.mode }} ) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2022] | |
kind: [static, shared] | |
mode: [release, debug, asan] | |
arch: [x64] | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.os }}-LLVM-${{ matrix.kind }}-${{ matrix.mode }} | |
steps: | |
- name: Configure Pagefile | |
uses: al-cheb/configure-pagefile-action@v1.3 | |
with: | |
minimum-size: 8GB | |
maximum-size: 32GB | |
disk-root: "D:" | |
- name: Get current date as package key | |
id: cache_key | |
run: echo "key=$(date +'%W')" >> $env:GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache LLVM | |
id: cache_llvm | |
uses: actions/cache@v4 | |
with: | |
path: ${{ runner.workspace }}/StormKit/llvm/ | |
key: ${{ matrix.os }}-llvm | |
save-always: true | |
restore-keys: | | |
${{ matrix.os }}-llvm | |
- name: Download and Uncompress LLVM | |
if: ${{ steps.cache_llvm.outputs.cache-hit != 'true' }} | |
run: | | |
C:/msys64/usr/bin/wget 'https://github.com/Arthapz/llvm-patched/raw/main/windows/llvm-x64.7z' | |
7z x llvm-x64.7z | |
rm llvm-x64.7z | |
- name: Set xmake env | |
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Install xmake | |
uses: xmake-io/github-action-setup-xmake@v1 | |
with: | |
xmake-version: "branch@dev" | |
actions-cache-folder: .xmake-cache-${{ steps.cache_key.outputs.key }} | |
- name: Update xmake to patched xmake | |
run: xmake update -s --integrate github:Arthapz/xmake#modules | |
- name: Update xmake repository | |
run: xmake repo --update -vD | |
- name: Retrieve dependencies hash | |
id: dep_hash | |
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
- name: Retrieve cached xmake dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages | |
key: ${{ matrix.os }}-LLVM-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-${{ steps.cache_key.outputs.key }} | |
- name: Configure & Build | |
id: build_llvm | |
run: | | |
xmake f -vD --yes -a ${{ matrix.arch }} -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --examples=y --tests=y --toolchain=llvm --sdk="${{ runner.workspace }}/StormKit/llvm/" --runtimes="c++_shared" | |
xmake b -vD | |
- name: Tests | |
run: | | |
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/StormKit/build/windows/${{ matrix.arch }}/${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }}/" | |
xmake test -vD | |
- name: Installation | |
run: | | |
xmake install -vD --installdir="${{ runner.workspace }}/output" | |
cp "${{ runner.workspace }}/StormKit/llvm/lib/c++.dll" "${{ runner.workspace }}/output/bin/" | |
rmdir /s /q "StormKit" | |
- name: Upload artifacts | |
id: upload | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.arch }}-LLVM-${{ matrix.kind }}-${{ matrix.mode }} | |
path: ${{ runner.workspace }}/output |