Skip to content

Create py.yml workflow file #3

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

Merged
merged 3 commits into from
Dec 29, 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
37 changes: 36 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,37 @@ on:
- main

jobs:
docs:
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: yarn install
working-directory: math-blocks
run: yarn install
- name: yarn build-tsc
working-directory: math-blocks
run: yarn build-tsc
- name: yarn typedoc
working-directory: math-blocks
run: yarn typedoc
- name: Upload Docs artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./docs/
name: docs

build:
needs: docs
permissions:
actions: read # to access artifacts from the build job
runs-on: ubuntu-latest
env:
CI: true
Expand Down Expand Up @@ -34,8 +64,13 @@ jobs:
run: yarn install --frozen-lockfile
- name: yarn build
run: yarn build
- name: download artifact
uses: actions/download-artifact@v4
with:
name: docs
path: ./dist/docs
- name: Upload Page Artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: ./dist/

Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Node CI

on:
push:
branches:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node_modules-
- name: yarn install
run: yarn install
- name: lint
run: yarn lint

build:
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node_modules-
- name: yarn install
run: yarn install
- name: yarn build
run: yarn build

docs:
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: yarn install
working-directory: math-blocks
run: yarn install
- name: yarn build-tsc
working-directory: math-blocks
run: yarn build-tsc
- name: yarn typedoc
working-directory: math-blocks
run: yarn typedoc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
dist
.buildcache
.vscode
.DS_Store
.vite
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "math-blocks"]
path = math-blocks
url = [email protected]:math-blocks/math-blocks.git
26 changes: 13 additions & 13 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ["dist", "math-blocks"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
)
}
);
1 change: 1 addition & 0 deletions math-blocks
Submodule math-blocks added at 71cc61
25 changes: 25 additions & 0 deletions src/homepage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from "react-router-dom";

const Homepage = () => {
return (
<div>
<h1>MathBlocks Demos</h1>
<ul>
<li>
<Link to="/baseline">Baseline</Link>
</li>
<li>
<Link to="/editor">Editor</Link>
</li>
<li>
<Link to="/parser">Parser</Link>
</li>
<li>
<Link to="/solver">Solver</Link>
</li>
</ul>
</div>
);
};

export default Homepage;
35 changes: 4 additions & 31 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { createRoot } from "react-dom/client";
import { createHashRouter, RouterProvider, Link } from "react-router-dom";
import { createHashRouter, RouterProvider } from "react-router-dom";

import Homepage from "./homepage";
import NotFound from "./not-found";

import BaselinePage from "./baseline/baseline-page";
import EditorPage from "./editor/editor-page";
Expand All @@ -12,36 +15,6 @@ if (document.body) {
document.body.appendChild(container);
}

const Homepage = () => {
return (
<div>
<h1>MathBlocks Demos</h1>
<ul>
<li>
<Link to="/baseline">Baseline</Link>
</li>
<li>
<Link to="/editor">Editor</Link>
</li>
<li>
<Link to="/parser">Parser</Link>
</li>
<li>
<Link to="/solver">Solver</Link>
</li>
</ul>
</div>
);
};

const NotFound = () => {
return (
<div>
<h1>404: Not Found</h1>
</div>
);
};

const router = createHashRouter([
{
path: "/",
Expand Down
9 changes: 9 additions & 0 deletions src/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const NotFound = () => {
return (
<div>
<h1>404: Not Found</h1>
</div>
);
};

export default NotFound;
Loading