Skip to content

Commit

Permalink
Add CI action to run tests on push (#26)
Browse files Browse the repository at this point in the history
* Add CI action to run tests on push

* Import syntax highlights from cjs instead of esm directory

Fixes jest syntax errors

See react-syntax-highlighter/react-syntax-highlighter#230 (comment)
  • Loading branch information
SamCarlberg authored Sep 24, 2024
1 parent b558026 commit 948c351
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on:
- push

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

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version-file: '.tool-versions'
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install Packages
run: |
npm ci
- name: Run Tests
run: |
npm run test
2 changes: 1 addition & 1 deletion src/ui/command/CommandGroupEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from "@mui/material"
import { entryType } from "./groupeditor/StageEditor"
import EditableLabel from "../EditableLabel"
import SyntaxHighlighter from "react-syntax-highlighter"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/esm/styles/hljs"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/cjs/styles/hljs"
import { commandMethod } from "../../codegen/java/CommandGroupGenerator"
import { editorGroupToIR } from "./Commands"
import * as IR from "../../bindings/ir"
Expand Down
2 changes: 1 addition & 1 deletion src/ui/robot/Robot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Project } from "../../bindings/Project"
import { generateRobotClass } from "../../codegen/java/RobotGenerator"
import { Box } from "@mui/material"
import SyntaxHighlighter from "react-syntax-highlighter"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/esm/styles/hljs"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/cjs/styles/hljs"

export function Robot({ project }: { project: Project }) {
const [generatedCode, setGeneratedCode] = useState(generateRobotClass(project))
Expand Down
2 changes: 1 addition & 1 deletion src/ui/subsystem/Subsystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import React, { CSSProperties, useEffect, useState } from "react"
import Menu from "@mui/material/Menu"
import MenuItem from "@mui/material/MenuItem"
import SyntaxHighlighter from "react-syntax-highlighter"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/esm/styles/hljs"
import * as SyntaxHighlightStyles from "react-syntax-highlighter/dist/cjs/styles/hljs"
import { ComponentDefinition, MethodDefinition, ParameterDefinition } from "../../components/ComponentDefinition"
import { generateCommand } from "../../codegen/java/CommandGenerator"
import { generateSubsystem } from "../../codegen/java/SubsystemGenerator"
Expand Down

0 comments on commit 948c351

Please sign in to comment.