From c2d6faa87762533da3f3abf1ddeb57fd38642781 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 18 Aug 2024 23:12:32 +0300 Subject: [PATCH] refactor: move scripts to ci (#250) Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com> --- .github/workflows/codeql.yaml | 4 ++-- .github/workflows/editorconfig.yaml | 2 +- .github/workflows/eslint.yaml | 13 +++++-------- .github/workflows/prettier.yaml | 2 +- .github/workflows/release.yaml | 6 +++--- .github/workflows/remark.yaml | 2 +- .github/workflows/spec.yaml | 13 +++++-------- lint-staged.config.js | 3 +-- package.json | 10 +--------- 9 files changed, 20 insertions(+), 35 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 3a6f424..00042ae 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -1,7 +1,7 @@ name: CodeQL on: - pull_request: + pull_request_target: branches: - main paths: @@ -45,7 +45,7 @@ jobs: - name: Auto Build uses: github/codeql-action/autobuild@v3 - - name: Perform Analysis + - name: Perform Code Analysis uses: github/codeql-action/analyze@v3 with: category: /language:${{ matrix.language }} diff --git a/.github/workflows/editorconfig.yaml b/.github/workflows/editorconfig.yaml index c03ea0d..c5c06af 100644 --- a/.github/workflows/editorconfig.yaml +++ b/.github/workflows/editorconfig.yaml @@ -32,4 +32,4 @@ jobs: run: pnpm i - name: Lint - run: pnpm lint:editorconfig + run: pnpm editorconfig-checker diff --git a/.github/workflows/eslint.yaml b/.github/workflows/eslint.yaml index 697bf7a..9aee1e8 100644 --- a/.github/workflows/eslint.yaml +++ b/.github/workflows/eslint.yaml @@ -1,24 +1,21 @@ name: ESLint on: - workflow_run: - workflows: - - CodeQL - types: - - completed pull_request: branches: - main + paths: + - src/**/*.ts push: branches: - main + paths: + - src/**/*.ts jobs: eslint: name: ESLint - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest timeout-minutes: 10 @@ -39,4 +36,4 @@ jobs: run: pnpm i - name: Lint - run: pnpm lint:ts + run: pnpm eslint src/**/*.ts diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml index 950fe4f..2e25221 100644 --- a/.github/workflows/prettier.yaml +++ b/.github/workflows/prettier.yaml @@ -32,4 +32,4 @@ jobs: run: pnpm i - name: Lint - run: pnpm lint:formatting + run: pnpm prettier . --check diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6838b1f..a2d7b0e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,8 +27,8 @@ jobs: id: generate_token uses: tibdex/github-app-token@v2 with: - app_id: ${{ secrets.RELEASE_UNBLOCKER_APP_ID }} - private_key: ${{ secrets.RELEASE_UNBLOCKER_APP_PRIVATE_KEY }} + app_id: ${{ secrets.ARCHOLEATER_APP_ID }} + private_key: ${{ secrets.ARCHOLEATER_APP_PRIVATE_KEY }} - name: Checkout Repository uses: actions/checkout@v4 @@ -55,4 +55,4 @@ jobs: env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - run: pnpm release + run: pnpm semantic-release diff --git a/.github/workflows/remark.yaml b/.github/workflows/remark.yaml index 1739755..ab920cc 100644 --- a/.github/workflows/remark.yaml +++ b/.github/workflows/remark.yaml @@ -36,4 +36,4 @@ jobs: run: pnpm i - name: Lint - run: pnpm lint:md + run: pnpm remark . --quiet --frail diff --git a/.github/workflows/spec.yaml b/.github/workflows/spec.yaml index 24572a1..6383230 100644 --- a/.github/workflows/spec.yaml +++ b/.github/workflows/spec.yaml @@ -1,24 +1,21 @@ name: Spec on: - workflow_run: - workflows: - - ESLint - types: - - completed pull_request: branches: - main + paths: + - src/**/*.ts push: branches: - main + paths: + - src/**/*.ts jobs: spec: name: Spec - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest timeout-minutes: 10 @@ -39,4 +36,4 @@ jobs: run: pnpm i - name: Specs - run: pnpm spec + run: pnpm vitest diff --git a/lint-staged.config.js b/lint-staged.config.js index f6d4b52..a2063fc 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,5 +1,4 @@ export default { - '**/*.md': 'remark --quiet --frail', - '**/*': 'prettier --write', + '*': 'prettier --write', 'src/**/*.ts': 'eslint --fix', }; diff --git a/package.json b/package.json index a1cc3af..e609733 100644 --- a/package.json +++ b/package.json @@ -62,15 +62,7 @@ ], "scripts": { "init": "pnpm i && husky", - "spec": "vitest", - "spec:coverage": "vitest run --coverage", - "build": "rollup -c rollup.config.ts --configPlugin typescript", - "release": "semantic-release", - "lint:editorconfig": "editorconfig-checker", - "lint:formatting": "prettier . --check", - "lint:md": "remark . --quiet --frail", - "lint:ts": "eslint src/**/*.ts --fix", - "prettify": "prettier . --write" + "build": "rollup -c rollup.config.ts --configPlugin typescript" }, "peerDependencies": { "stylelint": "^14.0.0 || ^15.0.0 || ^16.0.0"