Skip to content

Commit

Permalink
Include Windows and macOS Targets for CI (#39)
Browse files Browse the repository at this point in the history
* feat(data-pdf): fix `libpdfium` path in build script for macOS

Signed-off-by: Tarek <[email protected]>

* fix(windows): remove dependency on `pprof`, incompatible with windows

  `pprof` was only used for profiling benchmarks which is not critical. This was causing issues for building `ark-rust` on windows

Signed-off-by: Tarek <[email protected]>

* feat(ci): add macOS and windows jobs to github actions

Both run with each commit

Signed-off-by: Tarek <[email protected]>

* feat(ci): add a github workflow for binary releases

We're holding off on adding a macOS ARM check to our build workflow because it involves expenses. Testing it for every PR or commit might not be worth it, so we'll include it in the release workflow instead. Since we haven't set up a release workflow yet, we'll treat it as a reminder to run it when we do release builds.

Signed-off-by: Tarek <[email protected]>

* feat(docs): add logo and CI badges to README

Signed-off-by: Tarek <[email protected]>

* feat(ci): add main branch workflows to run on all machines

Signed-off-by: Tarek <[email protected]>

* feat(ci): add mac intel to main branch ci

Signed-off-by: Tarek <[email protected]>

---------

Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser authored May 11, 2024
1 parent c87108b commit babddd9
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 18 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,47 @@ env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Build ArkLib
linux:
name: Build on Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

components: rustfmt, clippy
- name: Check
run: cargo check

- name: Format
run: |
cargo fmt --all -- --check
cargo clippy
cargo clippy
- name: Build Debug
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Build Release
run: cargo build --verbose --release

windows:
name: Test on Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose

mac-intel:
name: Test on macOS Intel
runs-on: macos-11

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose
54 changes: 54 additions & 0 deletions .github/workflows/main_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Main Branch Workflow

on:
push:
branches:
- main
schedule:
# Run each week
- cron: "0 0 * * 0"

jobs:
linux:
name: Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose --release

windows:
name: Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose --release

mac-intel:
name: MacOS Intel
runs-on: macos-11

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose --release

mac-arm:
name: MacOS ARM
runs-on: macos-13-xlarge

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --workspace --verbose --release
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# ArkLib

This is the home of core ARK library.
<div align="center">
<img src="logo.svg" alt="ARK Logo" width="75%" />

[![License](https://img.shields.io/github/license/ARK-Builders/ark-rust.svg)](LICENSE)
[![Build Status](https://github.com/ARK-Builders/ark-rust/actions/workflows/build.yml/badge.svg)](https://github.com/ARK-Builders/ark-rust/actions/workflows/build.yml)

**The home of core ARK library**

</div>

Being implemented in Rust, it provides us capability to port all our apps to all common platforms. Right now, Android is supported by using the [arklib-android](https://github.com/arK-Builders/arklib-android) project. And for Linux/macOS/Windows, the library can be used as-is and easily embedded into an app, e.g. built with [Tauri](https://tauri.app/). Development docs will come sometime.

Expand Down
2 changes: 1 addition & 1 deletion data-pdf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn main() {
}
| OperatingSystem::Darwin => fs_extra::file::move_file(
PathBuf::from(&out_dir)
.join("bin")
.join("lib")
.join("libpdfium.dylib"),
PathBuf::from(&out_dir).join("libpdfium.dylib"),
&CopyOptions::new(),
Expand Down
1 change: 0 additions & 1 deletion data-resource/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ anyhow = "1"
[dev-dependencies]
# benchmarking
criterion = { version = "0.5", features = ["html_reports"] }
pprof = { version = "0.13", features = ["criterion", "flamegraph"] }
rand = "0.8"

[[bench]]
Expand Down
3 changes: 1 addition & 2 deletions data-resource/benches/compute_bytes_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use data_resource::ResourceId;
use pprof::criterion::{Output, PProfProfiler};
use rand::prelude::*;
use std::fs;

Expand Down Expand Up @@ -66,7 +65,7 @@ fn compute_bytes_on_files_benchmark(c: &mut Criterion) {

criterion_group!(
name = benches;
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
config = Criterion::default();
targets = compute_bytes_on_raw_data, compute_bytes_on_files_benchmark
);
criterion_main!(benches);
1 change: 0 additions & 1 deletion fs-index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ tempdir = "0.3.7"
rstest = '0.18.2'
# benchmarking
criterion = { version = "0.5", features = ["html_reports"] }
pprof = { version = "0.13", features = ["criterion", "flamegraph"] }
rand = "0.8"

[[bench]]
Expand Down
3 changes: 1 addition & 2 deletions fs-index/benches/index_build_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use criterion::{
black_box, criterion_group, criterion_main, BenchmarkId, Criterion,
};
use fs_index::index::ResourceIndex;
use pprof::criterion::{Output, PProfProfiler};

const DIR_PATH: &str = "../test-assets/"; // Set the path to the directory containing the resources here

Expand Down Expand Up @@ -36,7 +35,7 @@ fn index_build_benchmark(c: &mut Criterion) {

criterion_group! {
name = benches;
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
config = Criterion::default();
targets = index_build_benchmark
}
criterion_main!(benches);
1 change: 1 addition & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit babddd9

Please sign in to comment.