From 9afacac24dfa5462d50e8bfcda78098205acbf7d Mon Sep 17 00:00:00 2001 From: mateusz Date: Mon, 25 Dec 2023 19:51:26 +0100 Subject: [PATCH] feat: setup action for code style --- .github/workflows/check-code.yml | 16 ++++++++++++++++ .github/workflows/setup-node/action.yml | 8 ++++---- package.json | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/check-code.yml diff --git a/.github/workflows/check-code.yml b/.github/workflows/check-code.yml new file mode 100644 index 0000000..8966df9 --- /dev/null +++ b/.github/workflows/check-code.yml @@ -0,0 +1,16 @@ +name: check-code-style +on: push + +jobs: + check-code-style: + runs-on: ubuntu-latest + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + + - name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧 + uses: ./.github/workflows/setup-node + + - name: Code style ✅ + run: npm run check-code diff --git a/.github/workflows/setup-node/action.yml b/.github/workflows/setup-node/action.yml index 20157f3..42215fb 100644 --- a/.github/workflows/setup-node/action.yml +++ b/.github/workflows/setup-node/action.yml @@ -1,12 +1,12 @@ -name: 'setup_node-cache_dep-install_dep' -description: 'Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧' +name: "setup_node-cache_dep-install_dep" +description: "Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧" runs: - using: 'composite' + using: "composite" steps: - name: Setup Node.js ⚙️ uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: ".nvmrc" - name: Cache dependencies ⚡ id: cache_dependencies diff --git a/package.json b/package.json index 7845c01..b31967d 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "build": "next build", "start": "next start", "lint": "next lint", + "check-code": "prettier --check .", "format": "prettier --write .", "test": "jest --watch" },