Skip to content

Commit

Permalink
Adds CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Sep 13, 2023
1 parent 95be909 commit eb8bc3e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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
build-deps: ./build-deps.sh
artifact: nitro-linux-x86_64
- os: macos-latest
parallel: 3
build-deps: ./build-deps.sh
artifact: nitro-mac-x86_64
- os: windows-latest
parallel: 2
build-deps: .\build-deps.ps1
artifact: nitro-win-x86_64
runs-on: ${{ matrix.os }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.parallel }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore LLVM
uses: actions/cache/restore@v3
with:
path: deps/llvm/build
key: ${{ runner.os }}-llvm
- name: Build dependencies
run: ${{ matrix.build-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: ${{ runner.os }}-llvm-${{ 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist/
/lib/
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,26 @@ git clone --recurse-submodules https://github.com/ultimaweapon/nitro.git

### Build dependencies

#### Linux and macOS

Run the following command in the root of this repository:

#### Linux and macOS

```sh
CMAKE_BUILD_PARALLEL_LEVEL=2 ./build-deps.sh
```

#### Windows

```powershell
.\build-deps.ps1
```

### Build CLI

```sh
cargo install --path stage0 --root dist
```

## License

BSD-2-Clause Plus Patent License
25 changes: 25 additions & 0 deletions build-deps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LLVM
cmake `
--install-prefix "$PSScriptRoot/lib/llvm" `
-B "$PSScriptRoot/deps/llvm/build" `
-Wno-dev `
-DCMAKE_BUILD_TYPE:STRING=Release `
-DLLVM_ENABLE_ZSTD:BOOL=OFF `
-DLLVM_APPEND_VC_REV:BOOL=OFF `
"$PSScriptRoot/deps/llvm/llvm"

if ($LASTEXITCODE -ne 0) {
exit 1
}

cmake --build "$PSScriptRoot/deps/llvm/build" --config Release

if ($LASTEXITCODE -ne 0) {
exit 1
}

cmake --install "$PSScriptRoot/deps/llvm/build" --config Release

if ($LASTEXITCODE -ne 0) {
exit 1
}

0 comments on commit eb8bc3e

Please sign in to comment.