From c7bd7a0f1a402cf55f65c66a302d07dc63755e55 Mon Sep 17 00:00:00 2001 From: Artur Sudnik-Hrynkiewicz Date: Fri, 11 Aug 2023 19:48:45 +0200 Subject: [PATCH] chore: adding CI --- .github/workflows/ci.yaml | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..a84defc --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,54 @@ +on: push + +jobs: + install: + name: Install dependencies + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup app dependencies + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Cache node modules + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock') }} + restore-keys: | + ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock') }} + ${{ runner.os }}-node_modules + + - name: Install + run: npm ci + + lint: + name: Lint code + runs-on: ubuntu-latest + needs: [install] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup app dependencies + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Restore dependencies + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} + fail-on-cache-miss: true + + - name: Run prettier + run: yarn prettier:check + + - name: Run eslint + run: npm run lint