diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index e3c592910..9f28291c6 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -3,6 +3,9 @@ # If changes are needed, update the action npm in # https://github.com/mobsuccess-devops/github-mobsuccess-policy on: + merge_group: + types: + - checks_requested push: branches: [master, preprod, prod] pull_request: @@ -14,28 +17,28 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: mobsuccess-devops/github-actions-packagejsonlint@master prettier: name: Prettier runs-on: ubuntu-20.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: ^16.13 + node-version: 16.16.0 - name: Cache Node Modules id: cache - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - - run: npm install + - run: npm ci if: steps.cache.outputs.cache-hit != 'true' working-directory: . - run: npm run prettier @@ -45,21 +48,21 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: ^16.13 + node-version: 16.16.0 - name: Cache Node Modules id: cache - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - - run: npm install + - run: npm ci if: steps.cache.outputs.cache-hit != 'true' working-directory: . - run: npm run eslint @@ -69,21 +72,21 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 7 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: ^16.13 + node-version: 16.16.0 - name: Cache Node Modules id: cache - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: path: ./node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}-node-16.16.0 - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.MS_READ_PACKAGES_GITHUB_PAT }}" >> ~/.npmrc name: Configure Credentials For GitHub Packages - - run: npm install + - run: npm ci if: steps.cache.outputs.cache-hit != 'true' working-directory: . - run: npm run test