diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 0000000..7314c17 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,28 @@ +name: autofix.ci # needed to securely identify the workflow + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + autofix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - run: corepack enable + - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 + with: + node-version: 20.5 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Lint & Fix + run: pnpm run lint:fix + + - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6889bf0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - run: corepack enable + - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 + with: + node-version: 20.5 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Prepare + run: pnpm run dev:prepare + + - name: Lint files + run: pnpm run lint + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - run: corepack enable + - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 + with: + node-version: 20.5 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Prepare + run: pnpm run dev:prepare + + - name: Generate files + run: pnpm run prepack + + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - run: corepack enable + - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 + with: + node-version: 20.5 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Prepare + run: pnpm run dev:prepare + + - name: Run tests + run: pnpm run test diff --git a/package.json b/package.json index 349c85a..eec751e 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground", "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags", "lint": "eslint .", + "lint:fix": "eslint . --fix", "test": "vitest run", "test:watch": "vitest watch", "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"