From 7daaee06b82d90a8c3af27457587aae8b434724c Mon Sep 17 00:00:00 2001 From: xpadev Date: Mon, 19 Feb 2024 14:15:33 +0900 Subject: [PATCH 1/3] chore: rename and add workflows --- .github/workflows/pr-test-build.yml | 22 +++++++++++++++++++ ...alysis.yml => pr-test-codeql-analysis.yml} | 0 .github/workflows/pr-test-linter.yml | 22 +++++++++++++++++++ ...{playwright.yml => pr-test-playwright.yml} | 4 +++- .../{reviewdog.yml => pr-test-reviewdog.yml} | 0 ...ase.yml => release-createDraftRelease.yml} | 0 ...ackage.yml => release-publish-package.yml} | 0 .../{typedoc.yml => release-typedoc.yml} | 0 package.json | 7 +++--- 9 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pr-test-build.yml rename .github/workflows/{codeql-analysis.yml => pr-test-codeql-analysis.yml} (100%) create mode 100644 .github/workflows/pr-test-linter.yml rename .github/workflows/{playwright.yml => pr-test-playwright.yml} (93%) rename .github/workflows/{reviewdog.yml => pr-test-reviewdog.yml} (100%) rename .github/workflows/{createDraftRelease.yml => release-createDraftRelease.yml} (100%) rename .github/workflows/{publish-package.yml => release-publish-package.yml} (100%) rename .github/workflows/{typedoc.yml => release-typedoc.yml} (100%) diff --git a/.github/workflows/pr-test-build.yml b/.github/workflows/pr-test-build.yml new file mode 100644 index 00000000..7138cd95 --- /dev/null +++ b/.github/workflows/pr-test-build.yml @@ -0,0 +1,22 @@ +name: Playwright Tests +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "20" + - name: allow write in work dir + run: sudo chmod -R 777 . + - name: Install Dependencies + run: | + npm -g install pnpm + pnpm install + pnpm build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/pr-test-codeql-analysis.yml similarity index 100% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/pr-test-codeql-analysis.yml diff --git a/.github/workflows/pr-test-linter.yml b/.github/workflows/pr-test-linter.yml new file mode 100644 index 00000000..28e017a5 --- /dev/null +++ b/.github/workflows/pr-test-linter.yml @@ -0,0 +1,22 @@ +name: Playwright Tests +on: + push: + branches: [master, develop] + pull_request: + branches: [master, develop] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "20" + - name: allow write in work dir + run: sudo chmod -R 777 . + - name: Install Dependencies + run: | + npm -g install pnpm + pnpm install + pnpm lint diff --git a/.github/workflows/playwright.yml b/.github/workflows/pr-test-playwright.yml similarity index 93% rename from .github/workflows/playwright.yml rename to .github/workflows/pr-test-playwright.yml index f9b53a15..03a4c2da 100755 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/pr-test-playwright.yml @@ -19,9 +19,11 @@ jobs: run: | npm -g install pnpm pnpm install - pnpm build pnpm playwright install-deps pnpm playwright install firefox + - name: Building niconicomments + run: | + pnpm build - name: Run Playwright tests run: pnpm playwright test - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/pr-test-reviewdog.yml similarity index 100% rename from .github/workflows/reviewdog.yml rename to .github/workflows/pr-test-reviewdog.yml diff --git a/.github/workflows/createDraftRelease.yml b/.github/workflows/release-createDraftRelease.yml similarity index 100% rename from .github/workflows/createDraftRelease.yml rename to .github/workflows/release-createDraftRelease.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/release-publish-package.yml similarity index 100% rename from .github/workflows/publish-package.yml rename to .github/workflows/release-publish-package.yml diff --git a/.github/workflows/typedoc.yml b/.github/workflows/release-typedoc.yml similarity index 100% rename from .github/workflows/typedoc.yml rename to .github/workflows/release-typedoc.yml diff --git a/package.json b/package.json index f6ce6e6d..799799ad 100755 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ "check-types": "npx tsc --noEmit --jsx react", "eslint": "eslint src/**/*.ts", "eslint:fix": "eslint src/**/*.ts --fix", - "format": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"", - "lint": "npm run eslint&&npm run check-types", - "lint:fix": "npm run format&&npm run eslint:fix&&npm run check-types", + "format": "prettier --check \"src/**/*.{tsx,ts,js,json,css,scss}\"", + "format:fix": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"", + "lint": "npm run format&&npm run eslint&&npm run check-types", + "lint:fix": "npm run format:fix&&npm run eslint:fix&&npm run check-types", "prepare": "husky install", "test": "docker-compose run --rm pw", "test-server": "http-server" From 39ee947adda9c2872664a1a7c6a756f775b358de Mon Sep 17 00:00:00 2001 From: xpadev Date: Mon, 19 Feb 2024 14:17:16 +0900 Subject: [PATCH 2/3] fix: workflow name --- .github/workflows/pr-test-build.yml | 2 +- .github/workflows/pr-test-linter.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test-build.yml b/.github/workflows/pr-test-build.yml index 7138cd95..530c57a7 100644 --- a/.github/workflows/pr-test-build.yml +++ b/.github/workflows/pr-test-build.yml @@ -1,4 +1,4 @@ -name: Playwright Tests +name: BuildTests on: push: branches: [master, develop] diff --git a/.github/workflows/pr-test-linter.yml b/.github/workflows/pr-test-linter.yml index 28e017a5..60c88dff 100644 --- a/.github/workflows/pr-test-linter.yml +++ b/.github/workflows/pr-test-linter.yml @@ -1,4 +1,4 @@ -name: Playwright Tests +name: LinterTests on: push: branches: [master, develop] From 466f41f25008a33dcf501362e0b2f05dd215f194 Mon Sep 17 00:00:00 2001 From: xpadev Date: Mon, 19 Feb 2024 14:19:14 +0900 Subject: [PATCH 3/3] fix: step names --- .github/workflows/pr-test-build.yml | 3 ++- .github/workflows/pr-test-linter.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test-build.yml b/.github/workflows/pr-test-build.yml index 530c57a7..3db8ea63 100644 --- a/.github/workflows/pr-test-build.yml +++ b/.github/workflows/pr-test-build.yml @@ -19,4 +19,5 @@ jobs: run: | npm -g install pnpm pnpm install - pnpm build + - name: Building niconicomments + run: pnpm build diff --git a/.github/workflows/pr-test-linter.yml b/.github/workflows/pr-test-linter.yml index 60c88dff..6f4822a1 100644 --- a/.github/workflows/pr-test-linter.yml +++ b/.github/workflows/pr-test-linter.yml @@ -19,4 +19,5 @@ jobs: run: | npm -g install pnpm pnpm install - pnpm lint + - name: Run Linter tests + run: pnpm lint