Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run build
run: pnpm build
80 changes: 0 additions & 80 deletions .github/workflows/ci.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
pull_request:
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm lint
73 changes: 73 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test

on:
pull_request:
push:
branches:
- main
paths-ignore:
- docs/badges/test-count.json

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests with JSON report
run: pnpm exec vitest run --reporter=json --outputFile=tmp/vitest-report.json

- name: Generate test count badge payload
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdir -p docs/badges
node <<'EOF'
const fs = require('node:fs')
const report = JSON.parse(fs.readFileSync('tmp/vitest-report.json', 'utf8'))
const passed = report.numPassedTests ?? 0
const failed = report.numFailedTests ?? 0
const skipped = report.numPendingTests ?? 0
const suffix = skipped > 0 ? `, ${skipped} skipped` : ''
const message = failed > 0
? `${passed} passing, ${failed} failed${suffix}`
: `${passed} passing${suffix}`
const color = failed > 0 ? 'red' : passed >= 50 ? 'brightgreen' : 'green'
const badge = {
schemaVersion: 1,
label: 'tests',
message,
color,
}
fs.writeFileSync('docs/badges/test-count.json', `${JSON.stringify(badge, null, 2)}\n`)
EOF

- name: Commit badge update
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
if git diff --quiet -- docs/badges/test-count.json; then
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/badges/test-count.json
git commit -m "chore: update test count badge"
git push
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Ontic

![Lint](https://github.com/jdleo/ontic/actions/workflows/lint.yml/badge.svg)
![Build](https://github.com/jdleo/ontic/actions/workflows/build.yml/badge.svg)
![Test](https://github.com/jdleo/ontic/actions/workflows/test.yml/badge.svg)
![Test Count](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jdleo/ontic/main/docs/badges/test-count.json)
![React](https://img.shields.io/badge/React-19-20232a?logo=react)
![TypeScript](https://img.shields.io/badge/TypeScript-5-3178c6?logo=typescript&logoColor=white)
![Vite](https://img.shields.io/badge/Vite-8-646cff?logo=vite&logoColor=white)
![pnpm](https://img.shields.io/badge/pnpm-9-f69220?logo=pnpm&logoColor=white)
![Local-first](https://img.shields.io/badge/architecture-local--first-111111)
![Browser-first](https://img.shields.io/badge/runtime-browser--first-111111)

Ontic is a browser-first, local-first ontology and simulation tool for modeling a situation, asking questions about it, and mutating world state over time.

Expand Down
6 changes: 6 additions & 0 deletions docs/badges/test-count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"schemaVersion": 1,
"label": "tests",
"message": "local run",
"color": "lightgrey"
}
Binary file added docs/readme-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading