Skip to content

Commit 840bf46

Browse files
Merge pull request #23 from pierrelgol/main
Added basic CI configuration and updated README.md installation instructions
2 parents b702076 + b1db0de commit 840bf46

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.zig text eol=lf

.github/workflows/main.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the "main" branch
8+
push:
9+
branches: [ "main" ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
jobs:
17+
test:
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
runs-on: ${{matrix.os}}
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: goto-bus-stop/setup-zig@v2
25+
- run: zig build test

README.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,47 @@ A fluent-interface for chaining algorithms, iterating, and performing REGEX over
44

55
# Installation
66

7-
Fluent is a single file implementation. Add the `fluent.zig` file to your project and import like any standard utility.
7+
## Installation
8+
You can install the library by adding it to the `build.zig.zon` file, either manually like so:
9+
```zig
10+
.{
11+
...
12+
.dependencies = .{
13+
.Fluent = .{
14+
.url = "https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz",
15+
.hash = "...",
16+
}
17+
}
18+
...
19+
}
20+
```
21+
22+
The hash can be found using the builtin command:
23+
```sh
24+
zig fetch https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz
25+
```
26+
27+
Or you can also add it automatically like so:
28+
```sh
29+
zig fetch --save https://github.com/andrewCodeDev/Fluent/archive/refs/tags/release_2.3.3.tar.gz
30+
```
31+
32+
Then in the `build.zig`, you can add the following:
33+
```zig
34+
const Fluent = b.dependency("Fluent", .{
35+
.target = target,
36+
.optimize = optimize,
37+
});
38+
39+
exe.root_module.addImport("Fluent", Fluent.module("Fluent"));
40+
```
41+
42+
The name of the module (`Fluent`) can be changed to whatever you want.
43+
44+
Finally in your code you can import the module using the following:
45+
```zig
46+
const Fluent = @import("Fluent");
47+
```
848

949
# Examples
1050

0 commit comments

Comments
 (0)