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" } }