diff --git a/.github/actions/install-modules/action.yml b/.github/actions/configure-nodejs/action.yml similarity index 60% rename from .github/actions/install-modules/action.yml rename to .github/actions/configure-nodejs/action.yml index 4092fdef..b7e673e9 100644 --- a/.github/actions/install-modules/action.yml +++ b/.github/actions/configure-nodejs/action.yml @@ -1,17 +1,13 @@ -name: "Install Modules" -description: "Install Node.js modules or restore cache" +name: "Configure Node.js" +description: "Install Node.js and install Node.js modules or restore cache" inputs: node-version: description: "NodeJS Version" - required: true - github-pat: - description: "github.com PAT" - required: true + default: "18" lookup-only: description: "If true, only checks if cache entry exists and skips download. Does not change save cache behavior" - required: false - default: false + default: "false" runs: using: "composite" @@ -19,7 +15,6 @@ runs: - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - token: ${{ inputs.github-pat }} - name: Restore Node Modules from Cache id: cache-node-modules @@ -27,20 +22,18 @@ runs: with: path: | node_modules - apps/**/node_modules packages/**/node_modules - tests/**/node_modules !node_modules/.cache - key: node-modules-${{ inputs.node-version }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('yarn.lock') }} + key: node-modules-${{ inputs.node-version }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} lookup-only: ${{ inputs.lookup-only }} - - name: Install Yarn - shell: bash - run: | - if ! command -v yarn &> /dev/null - then - npm install -g yarn - fi + # - name: Install Yarn + # shell: bash + # run: | + # if ! command -v yarn &> /dev/null + # then + # npm install -g yarn + # fi - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fb62338..10784b06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,23 +50,7 @@ jobs: echo "PR_SUFFIX=" >> $GITHUB_ENV fi - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - - name: Optionally Install Node Modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + - uses: ./.github/actions/configure-nodejs # We do this here so the `build-jsii` modules are installed too # and become part of the cache - if we don't then @@ -119,19 +103,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} + - uses: ./.github/actions/configure-nodejs - name: Cache TypeScript Build Output id: cache-typescript-build @@ -198,23 +170,7 @@ jobs: echo 'PREFIX_U=' >> $GITHUB_ENV fi - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18.16.1 - - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - - name: Optionally Install Node Modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + - uses: ./.github/actions/configure-nodejs # - name: Cache TypeScript Build Output # id: cache-typescript-build @@ -626,23 +582,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - - name: Optionally Install Node Modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + - uses: ./.github/actions/configure-nodejs - name: Modify microapps-cdk tsconfig.json run: | diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 8dadd39d..3cff4f12 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -31,21 +31,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + - uses: ./.github/actions/configure-nodejs - name: Build All TypeScript run: yarn build - name: Run Node Tests @@ -123,24 +109,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Use Node.js 18 - uses: actions/setup-node@v4 - with: - node-version: 18 + - uses: ./.github/actions/configure-nodejs - name: Check for new commits id: git_remote run: echo latest_commit="$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - name: Optionally Install Node Modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile - name: Build Publish TypeScript run: yarn build:publish - name: Run Lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3e8843a..65898755 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,21 +29,7 @@ jobs: run: |- git config user.name "github-actions" git config user.email "github-actions@github.com" - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Cache Node Modules - id: cache-node-modules - uses: actions/cache@v4 - with: - path: | - node_modules - packages/**/node_modules - key: node-modules-${{ hashFiles('package.json', 'yarn.lock', '**/yarn.lock') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + - uses: ./.github/actions/configure-nodejs - name: Build All TypeScript run: yarn build - name: Run Node Tests