From 89fc949e187f3a56b7db9f05b301c2710d808843 Mon Sep 17 00:00:00 2001 From: Mobsuccess Bot Date: Thu, 1 Jun 2023 18:05:43 +0000 Subject: [PATCH] Add npm.yml GitHub workflow --- .github/workflows/npm.yml | 142 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..08a89db --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,142 @@ +# DO NOT EDIT: BEGIN +# This snippet has been inserted automatically by mobsuccessbot, do not edit! +# 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: + types: [opened, synchronize, reopened] +name: NPM +jobs: + packagejsonlint: + name: PackageJsonLint + runs-on: ubuntu-20.04 + timeout-minutes: 1 + steps: + - uses: actions/checkout@v3 + - uses: mobsuccess-devops/github-actions-packagejsonlint@master + sortpackagejson: + name: Sort Package Json + runs-on: ubuntu-20.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.16.0 + - name: Cache Node Modules + id: cache + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + 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 ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: npx --yes sort-package-json@2.4.1 --check + working-directory: . + prettier: + name: Prettier + runs-on: ubuntu-20.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.16.0 + - name: Cache Node Modules + id: cache + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + 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 ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: npm run prettier + working-directory: . + eslint: + name: Eslint + runs-on: ubuntu-20.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.16.0 + - name: Cache Node Modules + id: cache + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + 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 ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: npm run eslint + working-directory: . + typecheck: + name: Typecheck + runs-on: ubuntu-20.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.16.0 + - name: Cache Node Modules + id: cache + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + 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 ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: npm run typecheck + working-directory: . + test: + name: Test + runs-on: ubuntu-20.04 + timeout-minutes: 7 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.16.0 + - name: Cache Node Modules + id: cache + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ./node_modules + 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 ci + if: steps.cache.outputs.cache-hit != 'true' + working-directory: . + - run: npm run test + working-directory: . +# DO NOT EDIT: END