Skip to content

Commit

Permalink
ci: add CI action fp-52 (#71)
Browse files Browse the repository at this point in the history
* ci: add ci action fp-52

* ci: remove lint and tests action fp-52

* ci: improve lint script fp-52
  • Loading branch information
what1s1ove authored Dec 5, 2023
1 parent 58b4699 commit c19f11b
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 71 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Continuous Integration

on:
pull_request:
branches:
- main

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

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

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Cache Dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ci-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
ci-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
lint:
name: Code Linting
needs: dependencies
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ci-${{ hashFiles('**/package-lock.json') }}

- name: Code Linting
run: |
npm run lint
test:
name: Code Testing
needs: dependencies
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ci-${{ hashFiles('**/package-lock.json') }}

- name: Code Testing
run: |
npm run test
31 changes: 0 additions & 31 deletions .github/workflows/lint.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'*': npm run lint:fs && npm run lint:editorconfig
'*.{json,md,yml,js,ts,d.ts}': prettier --write,
'*.ts': npm run lint:ts
'*.{json,md,yml,js}': prettier --write,
'*.js': npm run lint:js && npm run lint:type
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
},
"scripts": {
"postinstall": "npx simple-git-hooks",
"format": "prettier --write \"**/*.{json,md,yml,js,ts,d.ts}\"",
"format": "prettier --write \"**/*.{json,md,yml,js}\"",
"lint:fs": "ls-lint",
"lint:editorconfig": "editorconfig-checker",
"lint:format": "prettier --check \"**/*.{json,md,yml,js,ts,d.ts}\"",
"lint:editor": "editorconfig-checker",
"lint:format": "prettier --check \"**/*.{json,md,yml,js}\"",
"lint:js": "eslint \"**/*.js\"",
"lint:type": "tsc --noEmit",
"lint": "npm run lint:fs && npm run lint:editorconfig && npm run lint:format && npm run lint:ts",
"lint": "npm run lint:fs && npm run lint:editor && npm run lint:format && npm run lint:js && npm run lint:type",
"test": "NODE_OPTIONS=--experimental-vm-modules npx jest",
"test:watch": "jest --watch",
"build:ts": "tsc && tscpaths -p tsconfig.json -s ./src -o ./build",
Expand Down
10 changes: 7 additions & 3 deletions tests/helpers/create-form-element/create-form-element.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import { createElement } from '../create-element/create-element.helper';
*/
const createFormElement = (...children) => {
return /** @type {HTMLFormElement} */ (
createElement(ElementName.FORM, {
name: ''
}, ...children)
createElement(
ElementName.FORM,
{
name: '',
},
...children,
)
);
};

Expand Down

0 comments on commit c19f11b

Please sign in to comment.