From 5a8748b2b0c415b83123c7a366b461d32cbd6765 Mon Sep 17 00:00:00 2001 From: "Kohei Ota (inductor)" Date: Sat, 15 Apr 2023 10:20:39 +0900 Subject: Update node version (#10639) --- .github/workflows/api-misskey-js.yml | 2 +- .github/workflows/lint.yml | 6 +++--- .github/workflows/storybook.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml index 6411d63bd5..ed004c78dc 100644 --- a/.github/workflows/api-misskey-js.yml +++ b/.github/workflows/api-misskey-js.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3.6.0 with: - node-version: 18.x + node-version-file: '.node-version' cache: 'pnpm' - name: Install dependencies diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c6615e17f..a15742dba7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: run_install: false - uses: actions/setup-node@v3.6.0 with: - node-version: 18.x + node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile @@ -48,7 +48,7 @@ jobs: run_install: false - uses: actions/setup-node@v3.6.0 with: - node-version: 18.x + node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile @@ -74,7 +74,7 @@ jobs: run_install: false - uses: actions/setup-node@v3.6.0 with: - node-version: 18.x + node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 6792674d9f..f77daf5868 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -25,7 +25,7 @@ jobs: - name: Use Node.js 18.x uses: actions/setup-node@v3.6.0 with: - node-version: 18.x + node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile -- cgit v1.2.3-freya From 0f7defc14a98b8ba97ee719cc809314b6779cca5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 19 Apr 2023 16:42:14 +0900 Subject: Update test-frontend.yml --- .github/workflows/test-frontend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index a5505d30d8..b0da3769a7 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -106,7 +106,7 @@ jobs: install: false start: pnpm start:test wait-on: 'http://localhost:61812' - headless: false + headed: true browser: ${{ matrix.browser }} - uses: actions/upload-artifact@v2 if: failure() -- cgit v1.2.3-freya From 6e0f998fb2cff15f2dec83cbd81b4bd2efe97095 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 26 Apr 2023 15:17:40 +0000 Subject: test: use pnpm v8 --- .github/workflows/lint.yml | 2 +- .github/workflows/storybook.yml | 2 +- .github/workflows/test-backend.yml | 2 +- .github/workflows/test-frontend.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a15742dba7..0f3702f958 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: submodules: true - uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 run_install: false - uses: actions/setup-node@v3.6.0 with: diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index f77daf5868..d5e6769bca 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -20,7 +20,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 run_install: false - name: Use Node.js 18.x uses: actions/setup-node@v3.6.0 diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index f1e414dbbc..d7be15bd4f 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -35,7 +35,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 run_install: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3.6.0 diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index b0da3769a7..4ea4ba4628 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -22,7 +22,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 run_install: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3.6.0 -- cgit v1.2.3-freya From 2d3d986d1306d5c92fe571431f63ed82510f4abe Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 29 Apr 2023 23:21:54 +0900 Subject: test: Check availability of production build (#10734) --- .github/workflows/test-production.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/test-production.yml (limited to '.github/workflows') diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml new file mode 100644 index 0000000000..5243a83777 --- /dev/null +++ b/.github/workflows/test-production.yml @@ -0,0 +1,42 @@ +name: Test (production install and build) + +on: + push: + branches: + - master + - develop + pull_request: + +env: + NODE_ENV: production + +jobs: + production: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3.3.0 + with: + submodules: true + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3.6.0 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - run: corepack enable + - run: pnpm i --frozen-lockfile + - name: Check pnpm-lock.yaml + run: git diff --exit-code pnpm-lock.yaml + - name: Copy Configure + run: cp .github/misskey/test.yml .config/default.yml + - name: Build + run: pnpm build -- cgit v1.2.3-freya From 3510768fd5507d72e89f6ae0939163cbda56aab8 Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Tue, 9 May 2023 00:14:42 +0900 Subject: ci: check for PRs (#10804) * ci: check for PRs * ci: run all PRs * ci: fix syntax error * ci: comment on PRs only * ci: use pull_request_target --- .github/workflows/storybook.yml | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index d5e6769bca..eb6ace27da 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -2,8 +2,10 @@ name: Storybook on: push: - branches-ignore: - - l10n_develop + branches: + - master + - develop + pull_request_target: jobs: build: @@ -17,6 +19,9 @@ jobs: with: fetch-depth: 0 submodules: true + - name: Checkout HEAD + if: github.event_name == 'pull_request' + run: git checkout ${{ github.head_ref }} - name: Install pnpm uses: pnpm/action-setup@v2 with: @@ -36,13 +41,13 @@ jobs: - name: Build storybook run: pnpm --filter frontend build-storybook - name: Publish to Chromatic - if: github.ref == 'refs/heads/master' + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' run: pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static env: CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - name: Publish to Chromatic - if: github.ref != 'refs/heads/master' - id: chromatic + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/master' + id: chromatic_push run: | DIFF="${{ github.event.before }} HEAD" if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then @@ -55,16 +60,31 @@ jobs: pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static $(echo "$CHROMATIC_PARAMETER") env: CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + - name: Publish to Chromatic + if: github.event_name == 'pull_request' + id: chromatic_pull_request + run: | + DIFF="${{ github.base_ref }} HEAD" + if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then + DIFF="HEAD" + fi + CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))" + if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then + echo "skip=true" >> $GITHUB_OUTPUT + fi + pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static $(echo "$CHROMATIC_PARAMETER") + env: + CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - name: Notify that Chromatic will skip testing uses: actions/github-script@v6.4.0 - if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' && steps.chromatic.outputs.skip == 'true' + if: github.event_name == 'pull_request' && steps.chromatic_pull_request.outputs.skip == 'true' with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - github.rest.repos.createCommitComment({ + github.rest.issues.createComment({ + issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - commit_sha: context.sha, body: 'Chromatic will skip testing but you may still have to [review the changes on Chromatic](https://www.chromatic.com/pullrequests?appId=6428f7d7b962f0b79f97d6e4).' }) - name: Upload Artifacts -- cgit v1.2.3-freya