Skip to content

Commit

Permalink
feat: set CI/CD Zig version
Browse files Browse the repository at this point in the history
  • Loading branch information
tensorush committed Jul 13, 2024
1 parent 428080f commit e3d8d6e
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run executable
- name: Run `exe`
run: |
zig build exe
rm -rf liza/
Expand All @@ -37,6 +39,8 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run formatting checks
- name: Run `fmt`
run: zig build fmt
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ zig build exe -- -h
### :sparkles: Features

- #### [Continuous integration GitHub workflow](src/templates/.github/workflows/ci.yaml):
- `?` (`exe` or `example`): executable's run or library's example suite execution.
- `exe` or `example` (`?`): executable's run or library's example suite execution.
- `test`: Test suite execution and code coverage publication to [Codecov](https://docs.codecov.com/docs/github-2-getting-a-codecov-account-and-uploading-coverage#install-the-github-app-integration).
- `fmt`: Formatting checks execution.

Expand All @@ -25,12 +25,12 @@ zig build exe -- -h

- #### [Zig executable template](src/templates/exe/):
- Dependency package usage.
- Custom README.
- README with badges.
- `build.zig.zon`.

- #### [Zig library template](src/templates/lib/):
- Examples' directory setup.
- Custom README.
- README with badges.
- `build.zig.zon`.

- #### [MIT license template](src/templates/LICENSE.md).
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const root_source_file = b.path("src/main.zig");
const version = std.SemanticVersion{ .major = 0, .minor = 2, .patch = 2 };
const version = std.SemanticVersion{ .major = 0, .minor = 3, .patch = 0 };

// Dependencies
const clap_dep = b.dependency("clap", .{
Expand Down
7 changes: 4 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = "liza",
.version = "0.2.2",
.version = "0.3.0",
.minimum_zig_version = "0.13.0",
.dependencies = .{
.clap = .{
Expand All @@ -11,8 +11,9 @@
.paths = .{
"src/",
"build.zig",
"README.md",
"LICENSE.md",
"build.zig.zon",

"LICENSE",
"README.md",
},
}
2 changes: 2 additions & 0 deletions src/templates/.github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run `doc`
run: zig build doc
Expand Down
8 changes: 7 additions & 1 deletion src/templates/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run `?`
run: zig build ?
Expand All @@ -34,9 +36,11 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run `test`
run: zig build test
run: zig build test --summary all

- name: Set up kcov
run: sudo apt install kcov
Expand All @@ -60,6 +64,8 @@ jobs:

- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Run `fmt`
run: zig build fmt
File renamed without changes.
5 changes: 3 additions & 2 deletions src/templates/lib/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"src/",
"examples/",
"build.zig",
"README.md",
"LICENSE.md",
"build.zig.zon",

"LICENSE",
"README.md",
},
}

0 comments on commit e3d8d6e

Please sign in to comment.