Skip to content

Commit

Permalink
set up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
truelossless committed Jul 26, 2022
1 parent 8a4ad34 commit 07eb0cc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
18 changes: 14 additions & 4 deletions .github/workfows/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: push
on: [push, pull_request]

jobs:
build_linux:
Expand All @@ -10,13 +10,13 @@ jobs:
- name: Build Dockerfile
run: docker build -t rust-cuda .

- name: Start Docker container
run: docker run rust-cuda -v $PWD:/root/rust-cuda --entrypoint /bin/bash --name builder
- name: Start Docker
run: docker run -t -d -v $PWD:/root/rust-cuda --name builder rust-cuda

- name: Build executable
run: docker exec -w /root/rust-cuda/cli builder cargo build --release

- name: Test
- name: Run Tests
run: |
docker exec -w /root/rust-cuda/commons builder cargo test --release
docker exec -w /root/rust-cuda/cpu builder cargo test --release
Expand All @@ -34,6 +34,11 @@ jobs:
- name: Clone repository
uses: actions/checkout@v3

- name: Install CUDA
uses: Jimver/[email protected]
with:
cuda: '11.7.0'

- name: Build executable
run: |
cd cli
Expand Down Expand Up @@ -62,13 +67,16 @@ jobs:
uses: actions/download-artifact@v3
with:
name: cug-windows

- name: Download Linux artifact
uses: actions/download-artifact@v3
with:
name: cug-linux

- name: Get commit infos
id: commit
run: echo "::set-output name=hash::$(echo ${GITHUB_SHA} | cut -c1-8)"

- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -80,6 +88,7 @@ jobs:
body: This is an automated build for commit ${{ steps.commit.outputs.hash }}.
draft: false
prerelease: true

- name: Upload Linux binary
uses: actions/upload-release-asset@v1
env:
Expand All @@ -89,6 +98,7 @@ jobs:
asset_path: cugparck-cli
asset_name: cug-linux-${{ steps.commit.outputs.hash }}
asset_content_type: application/octet-stream

- name: Upload Windows binary
uses: actions/upload-release-asset@v1
env:
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,26 @@ In particular, it implements the following features that may not be present in o

## Installation

No executable is currently provided but I will work on getting a CI pipeline running for at least the Linux and Windows builds.
### CLI

Compiling from source the CLI or library can be tough because a valid CUDA installation is required.
The Windows and Linux CLI binaries are available [here](https://github.com/truelossless/cugparck/releases).

### Library

The library will be added to [crates.io](https://crates.io/) once the documentation is good enough.

### Compiling from source

Compiling from source the CLI or the library can be tough because a valid CUDA installation is required.

On Windows if you're kind enough to the NVIDIA and LLVM gods no further steps are needed and a `cargo build --release` should do the trick.

On Linux your best bet is to use Docker to avoid incompabilities between the CUDA/GCC/LLVM toolchains. [Follow the instructions here to get started](https://github.com/Rust-GPU/Rust-CUDA/blob/master/guide/src/guide/getting_started.md#docker).

Note that a specific nightly Rust toolchain is required. It will be downloaded automatically thanks to the `rust-toolchain` file.

You can take a look at the `.github/workflows/ci.yml` file to see how the CI manages this process.

## Contributing

This project is available under the MIT licence. Pull requests are more than welcome :)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/stealdows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fn des_decrypt_hash(enc_hash: &[u8], rid: &[u8]) -> Digest {
let mut ntlm_2 = [0u8; HASH_LENGTH / 2];
des.decrypt_block_b2b(enc_ntlm_2.into(), GenericArray::from_mut_slice(&mut ntlm_2));

let mut hash: Digest = Digest::new();
let mut hash = Digest::new();
hash.extend_from_slice(&ntlm_1);
hash.extend_from_slice(&ntlm_2);

Expand Down
2 changes: 1 addition & 1 deletion commons/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate std;

mod ntlm;

pub use ntlm::ntlm;
use ntlm::ntlm;
pub use tinyvec::ArrayVec;

use core::{
Expand Down

0 comments on commit 07eb0cc

Please sign in to comment.