Skip to content

Initializes Codegen #12

Initializes Codegen

Initializes Codegen #12

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
parallel: 2
llvm: |
curl -Lo llvm.tar.xz "$LLVM_URL"
hash=$(md5sum llvm.tar.xz | head -c 32)
tar -xJ --strip-components=1 -C deps/llvm -f llvm.tar.xz
rm llvm.tar.xz
echo "key=linux-llvm-$hash" >> $GITHUB_OUTPUT
deps: ./build-deps.sh
artifact: nitro-linux-x86_64
- os: macos-latest
parallel: 3
llvm: |
curl -Lo llvm.tar.xz "$LLVM_URL"
hash=$(md5 < llvm.tar.xz)
tar -xJ --strip-components=1 -C deps/llvm -f llvm.tar.xz
rm llvm.tar.xz
echo "key=mac-llvm-$hash" >> $GITHUB_OUTPUT
deps: ./build-deps.sh
artifact: nitro-mac-x86_64
- os: windows-latest
parallel: 2
llvm: |
Invoke-WebRequest -Uri "$env:LLVM_URL" -OutFile llvm.tar.xz
$hash = (Get-FileHash llvm.tar.xz).Hash
unxz llvm.tar.xz
tar -x --strip-components=1 -C deps/llvm -f llvm.tar
Remove-Item llvm.tar
echo "key=win-llvm-$hash" >> $env:GITHUB_OUTPUT
deps: .\build-deps.ps1
artifact: nitro-win-x86_64
runs-on: ${{ matrix.os }}
env:
LLVM_URL: https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz
CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.parallel }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Download LLVM
run: ${{ matrix.llvm }}
id: llvm
- name: Restore LLVM cache
uses: actions/cache/restore@v3
with:
path: deps/llvm/build
key: ${{ steps.llvm.outputs.key }}
- name: Build dependencies
run: ${{ matrix.deps }}
- name: Build CLI
run: cargo install --path stage0 --root dist
- name: Cache LLVM
uses: actions/cache/save@v3
with:
path: deps/llvm/build
key: ${{ steps.llvm.outputs.key }}-${{ github.run_id }}
if: startsWith(github.ref, 'refs/heads/')
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact }}
path: |
dist
!dist/.crates.toml
!dist/.crates2.json