Skip to content

Commit

Permalink
add CI format check (#984)
Browse files Browse the repository at this point in the history
- some clean-up
- also removes a no longer needed work-around for macOS
  • Loading branch information
irahopkinson authored Jul 8, 2024
1 parent aa6a0b7 commit ca8507d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/assets/github-pages-index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:

- name: Install icu4c on macOS
if: ${{ matrix.os == 'macos-latest' }}
run: |
sudo port -v install icu
run: sudo port -v install icu

- name: Check out Git repository
uses: actions/checkout@v4
Expand All @@ -58,28 +57,33 @@ jobs:
- name: npm install
run: npm install

- name: Install DMG license
if: ${{ matrix.os == 'macos-latest' }}
run: npm install dmg-license

- name: Build
run: npm run build

- name: run dotnet unit tests
- name: dotnet unit tests
run: dotnet test c-sharp-tests/c-sharp-tests.csproj

- name: npm unit tests
run: npm test

- name: check dotnet formatting
run: cd c-sharp && dotnet tool restore && dotnet csharpier --check .
run: |
cd c-sharp
dotnet tool restore
dotnet csharpier --check .
- name: check JS/TS formatting
run: npm run format:check

- name: npm test
- name: check JS/TS linting
run: npm run lint

- name: check packaging
env:
# no hardlinks so dependencies are copied
USE_HARD_LINKS: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run lint
npm test
npm run package
run: npm run package

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Formatting happens automatically when you commit. If you use VS Code with this r
To check TypeScript for readability, maintainability, and functionality errors, and to check a few other files for proper formatting, run the following from the repo root (or just use VS Code with this repo's recommended extensions)

```bash
npm run prettier
npm run format
npm run lint
```

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"editor:link": "yalc link @biblionexus-foundation/platform-editor --no-pure",
"editor:update": "yalc update @biblionexus-foundation/platform-editor",
"editor:unlink": "yalc remove @biblionexus-foundation/platform-editor && npm i --ignore-scripts",
"postinstall": "patch-package && tsx .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "npm run build:types && npm run lint:scripts && npm run lint:styles && cd lib/papi-dts && npm run lint && cd ../../extensions && npm run lint",
"lint:scripts": "cross-env NODE_ENV=development eslint --ext .cjs,.js,.jsx,.ts,.tsx --cache .",
"lint:styles": "stylelint **/*.{css,scss}",
Expand All @@ -71,8 +72,8 @@
"lint:staged": "npm run build:types && lint-staged -q && cd lib/papi-dts && npm run lint:staged && cd ../../extensions && npm run lint:staged",
"package": "tsx ./.erb/scripts/clean.js dist && npm run build && npm run build:extensions:production && electron-builder build --publish never && npm run build:dll",
"package:debug": "cross-env DEBUG_PROD=true npm run package",
"postinstall": "patch-package && tsx .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
"prepare": "husky install && npm run csharp:tool:restore",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,csj,json,css,scss,html,md,yml}\"",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
"start": "tsx ./.erb/scripts/check-port-in-use.js && npm run start:renderer",
"start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only .",
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/testing/test-buttons-panel.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
border: 0;
appearance: none;
font-size: 1.3rem;
box-shadow: 0 8px 28px -6px rgba(24, 39, 75, 0.12), 0 18px 88px -4px rgba(24, 39, 75, 0.14);
box-shadow:
0 8px 28px -6px rgba(24, 39, 75, 0.12),
0 18px 88px -4px rgba(24, 39, 75, 0.14);
transition: all ease-in 0.1s;
cursor: pointer;
opacity: 0.9;
Expand Down
6 changes: 3 additions & 3 deletions src/stories/Intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ import Button from './Button';
import { Story, Meta } from '@storybook/react/types-6-0';

export default {
title: 'Components/Button',
component: Button,
title: 'Components/Button',
component: Button,
} as Meta;

const Template: Story<ButtonProps> = (args) => <Button {...args} />;

export const Primary = Template.bind({});
Primary.args = {
label: 'Translate',
label: 'Translate',
};
```

Expand Down

0 comments on commit ca8507d

Please sign in to comment.