From 9e11987dd71f942a903aeb94568eed4251d087e9 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Thu, 10 Apr 2025 23:15:51 +0900 Subject: [PATCH 1/2] NO-ISSUE fix mistake --- .github/workflows/generate-code.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-code.yml b/.github/workflows/generate-code.yml index 4cd47480c..0931fb396 100644 --- a/.github/workflows/generate-code.yml +++ b/.github/workflows/generate-code.yml @@ -2,6 +2,8 @@ name: Generate OpenAPI based code on: push: + branches: + - 'master' pull_request: merge_group: workflow_dispatch: @@ -46,15 +48,24 @@ jobs: echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV - ## Run if diff exists and pull request, and make CI status failure (but allow renovate bot) - - if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }} + ## Run if diff exists and pull request or merge queue, and make CI status failure (but allow renovate bot) + - if: >- + ${{ + (github.event_name == 'pull_request' || github.event_name == 'merge_group') + && env.DIFF_IS_EMPTY != 'true' + && github.actor != 'renovate[bot]' + }} run: | echo "There are changes in the generated codes. Please run 'generate-code.py' and commit the changes." >&2 echo "The files with differences are as follows." >&2 echo "$(git --no-pager diff --name-only HEAD)" >&2 exit 1 - ## Run if diff exists and event is not pull request, and make PR - - if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }} + ## Run if diff exists and event is push or workflow_dispatch, make PR + - if: >- + ${{ + (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + && env.DIFF_IS_EMPTY != 'true' + }} run: | # Determine Change Type via Submodule Script. This scripts read current uncommited changes. CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs) From 5cdc0da62b50d68685e6c3223c91da64df9e75ca Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 14 Apr 2025 09:10:40 +0900 Subject: [PATCH 2/2] NO-ISSUE format --- .github/workflows/test.yml | 96 ++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 422c328df..1d6fd8864 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,57 +14,61 @@ jobs: strategy: matrix: # https://nodejs.org/en/about/releases/ - node: [ '18', '20', '20.12.2', '22' ] + node: + - '18' + - '20' + - '20.12.2' + - '22' fail-fast: false name: Node.js ${{ matrix.node }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - - name: actions/setup-java@v3 - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 - with: - distribution: 'temurin' - java-version: 17 - architecture: x64 - - name: Setup Node.js - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 - with: - node-version: ${{ matrix.node }} - cache: 'npm' - - name: Install Dependency - run: npm ci - - name: Test generator - run: cd generator; mvn package; cd .. - - name: Generate code - run: | - python3 generate-code.py - - name: Test Project - run: export NODE_OPTIONS=--max-old-space-size=6144; npm test - - name: Test building apidocs - run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs - - name: Test building docs - run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build - - name: Test building examples (CJS) - run: | - cd examples/echo-bot-ts-cjs - npm run build-sdk - npm install - npm run build - cd - - - name: Test building examples (ESM) - run: | - cd examples/echo-bot-ts-esm - npm run build-sdk - npm install - npm run build - cd - - - name: publint - run: npx publint - - name: validate package - run: npx @arethetypeswrong/cli $(npm pack) + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: true + - name: Set up Java + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: 'temurin' + java-version: 17 + architecture: x64 + - name: Setup Node.js + uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + - name: Install Dependency + run: npm ci + - name: Test generator + run: cd generator; mvn package; cd .. + - name: Generate code + run: | + python3 generate-code.py + - name: Test Project + run: export NODE_OPTIONS=--max-old-space-size=6144; npm test + - name: Test building apidocs + run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs + - name: Test building docs + run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build + - name: Test building examples (CJS) + run: | + cd examples/echo-bot-ts-cjs + npm run build-sdk + npm install + npm run build + cd - + - name: Test building examples (ESM) + run: | + cd examples/echo-bot-ts-esm + npm run build-sdk + npm install + npm run build + cd - + - name: publint + run: npx publint + - name: validate package + run: npx @arethetypeswrong/cli $(npm pack) pinact: runs-on: ubuntu-latest