diff --git a/.github/.lintstagedrc.js b/.github/.lintstagedrc.js new file mode 100644 index 0000000..2e3c17a --- /dev/null +++ b/.github/.lintstagedrc.js @@ -0,0 +1,8 @@ +export default { + "*.js": ["eslint --no-ignore --fix", "prettier --write"], + "!(*dependabot).y?(a)ml": (filenames) => + filenames.flatMap((filename) => [ + `action-validator ${filename}`, + `prettier --write ${filename}`, + ]), +}; diff --git a/.github/actions/validate-setup/action.yaml b/.github/actions/validate-setup/action.yaml new file mode 100644 index 0000000..e2c3707 --- /dev/null +++ b/.github/actions/validate-setup/action.yaml @@ -0,0 +1,25 @@ +name: Setup for validate workflow +description: Reusable steps for validation jobs +runs: + using: composite + steps: + - uses: actions/setup-node@v4 + with: + node-version: lts/iron + - uses: pnpm/action-setup@v4 + + - name: Get pnpm store directory + shell: bash + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: | + pnpm i --frozen-lockfile + shell: bash diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..3deee26 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..749967b --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,33 @@ +name: Validate pushes to main and all PRs +on: + push: + branches: [main] + pull_request: + types: [opened, ready_for_review, reopened, synchronize] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate: + timeout-minutes: 10 + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/validate-setup + - name: Setup e2e tests + run: pnpm --filter=remix-testing-lab exec playwright install --with-deps + + - name: Validate project + run: pnpm exec turbo run build lint typecheck e2e --no-cache + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: remix-testing-lab/playwright-report/ + retention-days: 30 diff --git a/package.json b/package.json index 9618067..379f785 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "prepare": "is-ci || husky" }, "devDependencies": { + "@action-validator/cli": "^0.6.0", + "@action-validator/core": "^0.6.0", "@eslint/compat": "^1.1.1", "@types/eslint-plugin-jsx-a11y": "^6.9.0", "@types/is-ci": "^3.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f2d1808..109c8af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,12 @@ importers: .: devDependencies: + '@action-validator/cli': + specifier: ^0.6.0 + version: 0.6.0(@action-validator/core@0.6.0) + '@action-validator/core': + specifier: ^0.6.0 + version: 0.6.0 '@eslint/compat': specifier: ^1.1.1 version: 1.1.1 @@ -181,6 +187,15 @@ importers: packages: + '@action-validator/cli@0.6.0': + resolution: {integrity: sha512-Z8TYOK4GqUIpI0UuspUJPB6dhr0niTumhwI5iiZVqFRXm4u05bZawnFKltpvoFUfJg9mHbbIBlleqsRJAgl53Q==} + hasBin: true + peerDependencies: + '@action-validator/core': 0.6.0 + + '@action-validator/core@0.6.0': + resolution: {integrity: sha512-tPglwCr8Mm8SWzwnVewwFmqRx91F0WvMsM0BRAqH4CLalyGndm53Xvp+UcUSzswpk1wkjIDYI7RyEhWMLyPkig==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -1237,6 +1252,10 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + chalk@5.2.0: + resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} @@ -3994,6 +4013,13 @@ packages: snapshots: + '@action-validator/cli@0.6.0(@action-validator/core@0.6.0)': + dependencies: + '@action-validator/core': 0.6.0 + chalk: 5.2.0 + + '@action-validator/core@0.6.0': {} + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -5185,6 +5211,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + chalk@5.2.0: {} + chalk@5.3.0: {} character-entities-html4@2.1.0: {} diff --git a/turbo.json b/turbo.json index 751a0a7..12f6429 100644 --- a/turbo.json +++ b/turbo.json @@ -18,7 +18,6 @@ }, "e2e": { "dependsOn": ["build"] }, - "test": { "dependsOn": ["^build"] }, "lint": { "dependsOn": ["^build", "topo"] }, "typecheck": { "dependsOn": ["^build", "topo"] },