diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..53d13a7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: 'CI/CD Pipeline' + +on: + pull_request: + branches: [main, master] + types: [opened, synchronize] + +jobs: + style: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [16.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + run: npm ci + + - name: Check code formating + run: npm run test:format + if: always() + + - name: Lint the code + run: npm run test:lint + if: always()