From 670d2cd7c749c115a19dcd5dd32456a96a7da8ba Mon Sep 17 00:00:00 2001 From: Sudharaka Date: Sun, 10 Dec 2023 22:53:23 -0800 Subject: [PATCH] feat: add CI --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..387f47a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + lint: + runs-on: ubuntu-latest + + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: amplium/git-crypt-action@master + with: + key_encoded: ${{ secrets.DECRYPTION_SECRET }} + + - run: npm run lint:quiet + + prettier: + runs-on: ubuntu-latest + + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: amplium/git-crypt-action@master + with: + key_encoded: ${{ secrets.DECRYPTION_SECRET }} + + - run: npm run prettier:check - diff --git a/package.json b/package.json index 00b7dcb..118e524 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "scripts": { "start-booker": "node add-to-cart.mjs", "start-checker": "node check-for-changes.mjs", + "prettier:check": "prettier --check .", "prettier:write": "prettier --write .", + "lint:quiet": "npm run lint -- --quiet", "eslint:fix": "eslint . --ignore-path .gitignore --ext .mjs,.js --fix" } }