Skip to content

Commit

Permalink
justfile -> Taskfile; npm -> pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetdsouza committed Sep 28, 2024
1 parent aae3a30 commit ef1ef0c
Show file tree
Hide file tree
Showing 23 changed files with 5,212 additions and 2,783 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ jobs:
components: rustfmt
profile: minimal
toolchain: nightly
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node
uses: actions/setup-node@v3
with:
cache: npm
cache-dependency-path: playground/package-lock.json
cache: pnpm
cache-dependency-path: playground/pnpm-lock.yaml
node-version: 18
- name: Setup Rust cache
uses: Swatinem/rust-cache@v1
- name: Install just + wasm-pack
uses: taiki-e/install-action@v2
- name: Install Task
uses: arduino/setup-task@v2
with:
tool: just,wasm-pack
version: 3.x
- name: Run linters
run: just lint-all
run: task lint
test-miri:
runs-on: ubuntu-latest
strategy:
Expand All @@ -54,12 +56,14 @@ jobs:
toolchain: nightly
- name: Setup Rust cache
uses: Swatinem/rust-cache@v1
- name: Install cargo-nextest + just
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,just
tool: cargo-nextest
- name: Install Task
uses: arduino/setup-task@v2
- name: Run tests
run: just test-miri --no-fail-fast --partition=count:${{ matrix.partition }}/8 --test-threads=num-cpus
run: task test-miri -- --no-fail-fast --partition=count:${{ matrix.partition }}/8 --test-threads=num-cpus
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -72,9 +76,11 @@ jobs:
toolchain: stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v1
- name: Install cargo-nextest + just
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,just
tool: cargo-nextest
- name: Install Task
uses: arduino/setup-task@v2
- name: Run tests
run: just test --no-fail-fast
run: task test -- --no-fail-fast
6 changes: 4 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ jobs:
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node
uses: actions/setup-node@v3
with:
cache: npm
cache-dependency-path: playground/package-lock.json
cache: pnpm
cache-dependency-path: playground/pnpm-lock.yaml
node-version: 18
- name: Install Rust
uses: actions-rs/toolchain@v1
Expand Down
80 changes: 80 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: "3"
run: once

tasks:
build:
deps:
- build-loxcraft
- build-playground
build-loxcraft:
cmd: cargo build --all-features --all-targets --workspace
internal: true
build-playground:
deps:
- setup-playground
cmd: pnpm run build
dir: playground
internal: true

fmt:
deps:
- fmt-loxcraft
- fmt-playground
- fmt-lox-wasm
fmt-loxcraft:
cmd: cargo +nightly fmt --all
internal: true
fmt-playground:
deps:
- setup-playground
cmd: pnpm run fmt
dir: playground
internal: true
fmt-lox-wasm:
cmd: cargo +nightly fmt --all
dir: playground/rust/lox-wasm
internal: true

lint:
deps:
- lint-loxcraft-clippy
- lint-loxcraft-rustfmt
- lint-playground
- lint-lox-wasm-clippy
- lint-lox-wasm-rustfmt
lint-loxcraft-clippy:
cmd: cargo clippy --all-features --all-targets --workspace -- --deny=warnings
internal: true
lint-loxcraft-rustfmt:
cmd: cargo +nightly fmt --all -- --check
internal: true
lint-playground:
deps:
- setup-playground
cmd: pnpm run lint
dir: playground
internal: true
lint-lox-wasm-clippy:
cmd: cargo clippy --all-features --all-targets --workspace -- --deny=warnings
dir: playground/rust/lox-wasm
internal: true
lint-lox-wasm-rustfmt:
cmd: cargo +nightly fmt --all -- --check
dir: playground/rust/lox-wasm
internal: true

setup:
deps:
- setup-playground
setup-playground:
cmd: pnpm install --prefer-frozen-lockfile
dir: playground
internal: true

test:
cmd: cargo nextest run --features='gc-stress,gc-trace,vm-trace' --workspace {{.CLI_ARGS}}

test-miri:
cmd: >
MIRIFLAGS='-Zmiri-disable-isolation'
cargo +nightly miri nextest run --features='gc-stress,gc-trace,vm-trace' --no-default-features --workspace {{.CLI_ARGS}}
41 changes: 0 additions & 41 deletions justfile

This file was deleted.

3 changes: 3 additions & 0 deletions playground/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
1 change: 1 addition & 0 deletions playground/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rust/
3 changes: 3 additions & 0 deletions playground/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "all"
}
8 changes: 3 additions & 5 deletions playground/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import {
} from "@/components/ui/resizable";
import { Github, Loader2, Lock, Play } from "lucide-react";
import Link from "next/link";
import { useEffect, useState } from "react";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import "ace-builds/src-noconflict/theme-tomorrow_night_bright";
import dynamic from "next/dynamic";
import React from "react";
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import Head from "next/head";
import { persist } from "zustand/middleware";

type LoxOutMessageOutput = {
type: "Output";
Expand Down Expand Up @@ -134,8 +132,8 @@ const useStore = create<State & Action>()(
editorText: state.editorText,
outputText: state.outputText,
}),
}
)
},
),
);

function Page() {
Expand Down
2 changes: 1 addition & 1 deletion playground/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
Loading

0 comments on commit ef1ef0c

Please sign in to comment.