Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix website build #20

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish_site

on:
push:
branches: ["main"]
tags: ['v*.*.*']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -23,8 +23,7 @@ concurrency:
cancel-in-progress: false

jobs:
# Build job
build:
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -49,14 +48,12 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
path: ./site/_site

# Deployment job
deploy:
deploy-site:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
needs: build-site
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
- name: test
run: zig build test
- name: lint
run: zig fmt --check .
if: always()
3 changes: 3 additions & 0 deletions site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ nav_order: 0
Fizz is a **simple** interpretted programming language meant for **embedding in
Zig**.

{: .warning}
> Requires Zig 0.13.0

{: .warning}
> Fizz is not yet in a stable state. If you have a use case that you would like
> handled, file an [🪲 issue](https://github.com/wmedrano/fizz/issues).
Expand Down
2 changes: 0 additions & 2 deletions src/Vm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ pub fn evalNoReset(self: *Vm, func: Val, args: []const Val) Error!Val {
self.env.stack.items = self.env.stack.items[0..stack_start];
return ret;
} else {
@setCold(true);
return .none;
}
},
Expand Down Expand Up @@ -406,7 +405,6 @@ fn executeDefine(self: *Vm, symbol: Symbol) Error!void {
}

fn errSymbolNotFound(self: *Vm, sym: Symbol) Error {
@setCold(true);
const name = self.env.memory_manager.symbols.getName(sym) orelse "*unknown-symbol*";
try self.env.errors.addError(
"Symbol {s} (id={d}) not found in global values",
Expand Down
6 changes: 0 additions & 6 deletions src/datastructures/ErrorCollector.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,33 @@ const std = @import("std");
errors: std.ArrayList([]const u8),

pub fn init(alloc: std.mem.Allocator) ErrorCollector {
@setCold(true);
return .{
.errors = std.ArrayList([]const u8).init(alloc),
};
}

pub fn deinit(self: *ErrorCollector) void {
@setCold(true);
self.clear();
self.errors.deinit();
}

pub fn allocator(self: *ErrorCollector) std.mem.Allocator {
@setCold(true);
return self.errors.allocator;
}

pub fn clear(self: *ErrorCollector) void {
@setCold(true);
for (self.errors.items) |msg| {
self.errors.allocator.free(msg);
}
self.errors.clearRetainingCapacity();
}

pub fn addError(self: *ErrorCollector, comptime fmt: []const u8, args: anytype) !void {
@setCold(true);
const msg = try std.fmt.allocPrint(self.allocator(), fmt, args);
try self.errors.append(msg);
}

pub fn format(self: *const ErrorCollector, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
@setCold(true);
for (self.errors.items) |err| {
try writer.print("{s}\n", .{err});
}
Expand Down
Loading