Skip to content

Commit

Permalink
fix(ci): fix running benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Beast committed Jun 28, 2024
1 parent b6e49f9 commit 0a4e97f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
run: deno publish --dry-run

- name: Run benchmarks
# TODO: Cross-runtime benchmarks
run: deno task bench

- name: Check license headers
Expand Down
6 changes: 4 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"imports": {
// tests
"@std/assert": "jsr:@std/assert@0.221.0",
"@beast/compat": "jsr:@beast/compat@^0.2.5"
"@beast/compat": "jsr:@beast/compat@^0.2.5",
// bench
"@crayon/literal": "jsr:@crayon/literal@1.0.0-alpha.1"
},

"exports": {
Expand All @@ -24,7 +26,7 @@
"tasks": {
"test": "deno test --coverage --fail-fast=1 --allow-env",

"bench": "deno bench --allow-read --ignore=node --allow-env",
"bench": "deno bench --no-check --allow-read --ignore=node --allow-env",
"bench-nocolor": "NO_COLOR=1 deno task bench",
"bench-colorless": "COLORTERM='' TERM='' deno task bench",

Expand Down
8 changes: 8 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions tests/bench.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2024 Im-Beast. All rights reserved. MIT license.
import crayon, { buildCrayon } from "../main.ts";
// TODO: Add literal benchmarks after literal extension has been published
import "@crayon/literal";

import chalk4 from "npm:chalk@^4";
import chalk5, { Chalk } from "npm:chalk@^5";
Expand Down Expand Up @@ -266,7 +266,7 @@ async function chainFunctions() {
// Kleur and Ansi-colors don't have color functions
}

async function _shortLiteral() {
async function shortLiteral() {
const group = "short-literal";

await Deno.bench({
Expand All @@ -288,7 +288,7 @@ async function _shortLiteral() {
// Cliffy, Kleur and Ansi-colors don't support literal templating
}

async function _longLiteral() {
async function longLiteral() {
const group = "long-literal";

await Deno.bench({
Expand All @@ -310,7 +310,7 @@ async function _longLiteral() {
// Cliffy, Kleur and Ansi-colors don't support literal templating
}

async function _longTextLiteral() {
async function longTextLiteral() {
const group = "long-text-literal";

await Deno.bench({
Expand Down Expand Up @@ -360,8 +360,8 @@ cachedShortChain();
cachedLongChain();
chainFunctions();

// shortLiteral();
// longLiteral();
// longTextLiteral();
shortLiteral();
longLiteral();
longTextLiteral();

generateInstance();

0 comments on commit 0a4e97f

Please sign in to comment.