Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5ab1a8d
Added simple linter and code formatter yaml
Sep 24, 2025
5f66195
Written basic CI that imports linting yaml
Sep 29, 2025
1a37356
Made Prettier changes and fixed yaml files
Sep 29, 2025
2dbbaf8
Added prettier scripts
Sep 29, 2025
8296460
Added linting script to CI
Sep 29, 2025
2e3d4b8
Added typescript check too
Sep 29, 2025
814804f
Created skeleton for CI
Sep 29, 2025
a59976a
Renamed tests
Sep 29, 2025
e95cba7
Added accessibility to linting
Sep 29, 2025
46be6ba
Removed unnecessary CI jobs
Sep 29, 2025
182fe0b
Updated CI and added Husky
Sep 30, 2025
f98ff81
Added lint and format to husky and fixed videostream
Sep 30, 2025
b27b4e7
Added simple linter and code formatter yaml
Sep 24, 2025
5c002ba
Written basic CI that imports linting yaml
Sep 29, 2025
37b2ba3
Made Prettier changes and fixed yaml files
Sep 29, 2025
d4c0bcd
Added prettier scripts
Sep 29, 2025
21658e9
Added linting script to CI
Sep 29, 2025
8de03c8
Added typescript check too
Sep 29, 2025
383432d
Created skeleton for CI
Sep 29, 2025
11b7ec2
Renamed tests
Sep 29, 2025
793b95e
Added accessibility to linting
Sep 29, 2025
21f2ac4
Removed unnecessary CI jobs
Sep 29, 2025
778f09c
Updated CI and added Husky
Sep 30, 2025
64d7897
Added lint and format to husky and fixed videostream
Sep 30, 2025
88a8c7f
Merge branch '21-Set-up-CI' of github.com:DiamondLightSource/mx-daq-u…
Sep 30, 2025
426b938
Merge branch 'main' of github.com:DiamondLightSource/mx-daq-ui into 2…
Oct 27, 2025
894d1f1
NPM install to update package-lock.json
Oct 27, 2025
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
29 changes: 29 additions & 0 deletions .github/workflows/_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run audit
run: npm audit --audit-level=high

- name: Run Prettier
run: npm run prettier

- name: Run ESLint
run: npm run lint

- name: Run TypeScript Compiler
run: npm run tscheck
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on: [push, pull_request]
on:
workflow_call:

jobs:
build:
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["add-actions"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
Expand All @@ -30,22 +23,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: "./dist"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
pull_request:

jobs:
lint:
uses: ./.github/workflows/_lint.yaml

test:
uses: ./.github/workflows/_tests.yaml

e2e:
runs-on: ubuntu-latest
steps:
- name: Placeholder for end-to-end tests
run: echo "End-to-end and browser tests would run here"

docs:
runs-on: ubuntu-latest
steps:
- name: Placeholder for documentation generation
run: echo "Documentation generation like storybook would run here"

performance:
runs-on: ubuntu-latest
steps:
- name: Placeholder for performance tests
run: echo "Performance like Lighthouse tests would run here"
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm run lint
npm run prettier
npm test
15 changes: 9 additions & 6 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@ import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import jsxA11y from "eslint-plugin-jsx-a11y";

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
languageOptions: { ecmaVersion: 2020, globals: globals.browser },
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"jsx-a11y": jsxA11y,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
...jsxA11y.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
Expand All @@ -33,5 +36,5 @@ export default tseslint.config(
},
],
},
}
},
);
Loading