diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml deleted file mode 100644 index 381b0147..00000000 --- a/.github/actions/setup-node/action.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Node.js Setup -description: Setup Node.js for CI/CD -runs: - using: composite - steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .tool-versions \ No newline at end of file diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..d2c15dd5 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,26 @@ +name: Setup +description: Setup development environment +inputs: + node-version-matrix: + required: false + description: you can use matrix strategy + default: 'false' +runs: + using: composite + steps: + - name: Setup Node.js + if: ${{ inputs.node-version-matrix == 'false' }} + uses: actions/setup-node@v4 + with: + node-version-file: .tool-versions + - name: Setup Node.js + if: ${{ inputs.node-version-matrix != 'false' }} + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version-matrix }} + - name: Enable corepack + shell: bash + run: corepack enable + - name: Install dependencies + shell: bash + run: yarn install --immutable diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml index 1dc05265..aeabf310 100644 --- a/.github/workflows/build-examples.yml +++ b/.github/workflows/build-examples.yml @@ -9,10 +9,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: ./.github/actions/setup-node - - name: Install dependencies - run: yarn install --immutable + - name: Setup + uses: ./.github/actions/setup - name: Build run: yarn prebuild && yarn build working-directory: ./examples/react diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index bf543f70..6a41948e 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -9,10 +9,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: ./.github/actions/setup-node - - name: Install dependencies - run: yarn install --immutable + - name: Setup + uses: ./.github/actions/setup - name: Build run: yarn build working-directory: ./website diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67acd032..c801fdbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,16 +8,14 @@ jobs: strategy: matrix: node: ['18', '20', '22'] - name: CI (Node.js ${{ matrix.node }}) + name: Node.js ${{ matrix.node }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Setup + uses: ./.github/actions/setup with: - node-version: ${{ matrix.node }} - - name: Install dependencies - run: yarn install --immutable + node-version-matrix: ${{ matrix.node }} - name: Check Type run: yarn typecheck - name: Check Lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22b7e539..14b9265f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node.js - uses: ./.github/actions/setup-node - - name: Install dependencies - run: yarn install --immutable + - name: Setup + uses: ./.github/actions/setup - name: Check Type run: yarn typecheck - name: Check Lint diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index 6e8271f8..2d120631 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -10,12 +10,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Setup Node.js - uses: ./.github/actions/setup-node - - name: Install dependencies - run: yarn install --immutable + - name: Setup + uses: ./.github/actions/setup - name: Run CI working-directory: packages/calendar run: yarn run test:playwright