diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 0000000..cfbb32f --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,14 @@ +name: Black + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: psf/black@stable diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..190124d --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,28 @@ +name: ESLint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install node dependencies + run: npm install + - name: Run ESLint + run: npm run ci-eslint diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..233e991 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,30 @@ +name: Prettier + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install node dependencies + run: npm install + - name: Run Prettier + run: npm run ci-prettier diff --git a/package.json b/package.json index 2161421..21b076c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,9 @@ "start": "react-scripts start", "build": "react-scripts build", "eject": "react-scripts eject", - "format": "prettier --check **/*.{ts,tsx}" + "format": "prettier --write **/*.{ts,tsx}", + "ci-prettier": "prettier --check **/*.{ts,tsx}", + "ci-eslint": "eslint **/*.{ts,tsx}" }, "eslintConfig": { "extends": [