Skip to content

Commit

Permalink
ci: add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed Aug 5, 2024
1 parent 736ed60 commit 4c324ed
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 440 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI (repo level)

on:
push:
branches:
- main
- "release-*"
pull_request:
branches:
- main
- "release-*"
workflow_dispatch:
workflow_call:

jobs:
build:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: npm ci .
- run: npm run check
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Library, IDE and build locations
**/node_modules/
**/coverage/
**/dist/
.vscode/
.idea/
.eslintcache/

#
# NOTE: Could ignore anything that eslint will look at since eslint also applies
# prettier.
#
14 changes: 14 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import("prettier").Config} */
const config = {
trailingComma: "es5", // es5 was the default in prettier v2
semi: true,
singleQuote: false,

// Values used from .editorconfig:
// - printWidth == max_line_length
// - tabWidth == indent_size
// - useTabs == indent_style
// - endOfLine == end_of_line
};

export default config;
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# End-to-end tests for trustify-ui

### Requirements

- NodeJS 21
- A running instance of Trustify

### Running the tests

- Install dependencies:

```shell
npm ci
```

- Point the tests to a running instance of trustify:

```shell
export TRUSTIFY_URL=http://localhost:8080
```

- Run tests:

```shell
npx playwright test
```

- Or if you prefer to run the tests and see the Playwright UI use:

```shell
npm run test
```
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"main": "index.js",
"scripts": {
"codegen": "npx playwright codegen http://localhost:8080/",
"test": "npx playwright test --ui --trace on"
"test": "npx playwright test --ui --trace on",
"check": "prettier --check './**/*.{ts,js,json}'",
"format": "prettier --write './**/*.{ts,js,json}'"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.45.3",
"@types/node": "^22.0.2"
"@types/node": "^22.0.2",
"prettier": "^3.3.3"
}
}
Loading

0 comments on commit 4c324ed

Please sign in to comment.