diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..a532d52 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,68 @@ +name: Linting & formatting + +on: + push: + branches: ["master", "actions"] + workflow_dispatch: + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + with: + version: 9 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Format code + run: pnpm run format + + - name: Check for Changes + id: check_changes + run: | + git diff --exit-code || echo "::set-output name=changes::true" + + - name: Commit Changes + if: steps.check_changes.outputs.changes == 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Auto-format code" + + - name: Push Changes + if: steps.check_changes.outputs.changes == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref_name }} + + lint: + runs-on: ubuntu-latest + needs: formatting + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint it + run: pnpm run lint:no-fmt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d98fbb4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Test using vitest + +on: + push: + branches: "master" + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + with: + version: 9 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Test it + run: pnpm run test diff --git a/package.json b/package.json index 14e6117..708f5bb 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,10 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "test": "vitest", "lint": "prettier --check . && eslint .", + "lint:no-fmt": "eslint .", "format": "prettier --write ." }, "devDependencies": { - "@skeletonlabs/skeleton": "^2.10.0", - "@skeletonlabs/tw-plugin": "^0.4.0", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 055637a..432be84 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,12 +36,6 @@ importers: specifier: ^3.23.5 version: 3.23.5 devDependencies: - '@skeletonlabs/skeleton': - specifier: ^2.10.0 - version: 2.10.0(svelte@4.2.15) - '@skeletonlabs/tw-plugin': - specifier: ^0.4.0 - version: 0.4.0(tailwindcss@3.4.3) '@sveltejs/adapter-auto': specifier: ^3.0.0 version: 3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@4.2.15)(vite@5.2.10))(svelte@4.2.15)(vite@5.2.10)) @@ -426,16 +420,6 @@ packages: '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - '@skeletonlabs/skeleton@2.10.0': - resolution: {integrity: sha512-jPdDT9PCkGmlUgsgNvR99bK6N2pWG2GfdapwWqDVZkKIhTsLz4TeJNF3H26Pfkicoj4hNz486+WYa7iSpbn80g==} - peerDependencies: - svelte: ^3.56.0 || ^4.0.0 - - '@skeletonlabs/tw-plugin@0.4.0': - resolution: {integrity: sha512-v6Y4deBq9ByRx3kTRGgekhhYkWEYgNNNu8UXOwJngCStB7w8SwmbNFSeHkluxMbgCgMnJyp220EMpw9nj/rEsQ==} - peerDependencies: - tailwindcss: '>=3.0.0' - '@steeze-ui/heroicons@2.3.0': resolution: {integrity: sha512-tVOamjAd9ZzXgDwVKwbA3K+o86Z1ks/IMvqdgoCf9hKeGINVUIlAlGhM3wdpSmt7brIoBLgR70wlnsXGytZk9g==} @@ -2086,15 +2070,6 @@ snapshots: '@sinclair/typebox@0.27.8': {} - '@skeletonlabs/skeleton@2.10.0(svelte@4.2.15)': - dependencies: - esm-env: 1.0.0 - svelte: 4.2.15 - - '@skeletonlabs/tw-plugin@0.4.0(tailwindcss@3.4.3)': - dependencies: - tailwindcss: 3.4.3 - '@steeze-ui/heroicons@2.3.0': {} '@sveltejs/adapter-auto@3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@4.2.15)(vite@5.2.10))(svelte@4.2.15)(vite@5.2.10))':