Skip to content

Commit

Permalink
Merge pull request #23 from pierrelgol/main
Browse files Browse the repository at this point in the history
Added basic CI configuration and updated README.md installation instructions
  • Loading branch information
andrewCodeDev authored Sep 8, 2024
2 parents b702076 + b1db0de commit 840bf46
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zig text eol=lf
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
- run: zig build test
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,47 @@ A fluent-interface for chaining algorithms, iterating, and performing REGEX over

# Installation

Fluent is a single file implementation. Add the `fluent.zig` file to your project and import like any standard utility.
## Installation
You can install the library by adding it to the `build.zig.zon` file, either manually like so:
```zig
.{
...
.dependencies = .{
.Fluent = .{
.url = "https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz",
.hash = "...",
}
}
...
}
```

The hash can be found using the builtin command:
```sh
zig fetch https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz
```

Or you can also add it automatically like so:
```sh
zig fetch --save https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz
```

Then in the `build.zig`, you can add the following:
```zig
const Fluent = b.dependency("Fluent", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("Fluent", Fluent.module("Fluent"));
```

The name of the module (`Fluent`) can be changed to whatever you want.

Finally in your code you can import the module using the following:
```zig
const Fluent = @import("Fluent");
```

# Examples

Expand Down

0 comments on commit 840bf46

Please sign in to comment.