Skip to content

feat(nr-labs-widget-pack): Update to version v1.45.0 #957

feat(nr-labs-widget-pack): Update to version v1.45.0

feat(nr-labs-widget-pack): Update to version v1.45.0 #957

Workflow file for this run

name: Pull request
on:
pull_request:
branches:
- master
paths:
- "apps/**"
jobs:
checkout-and-build-pr:
runs-on: ubuntu-latest
steps:
# Checkout PR branch and all history (not just last commit), so we can perform `git diff` below
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# Checkout submodules
# Note: Uses 8 jobs for checking out submodules quicker
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
#git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1 --recursive --jobs 8
# Get Submodule_name using Git Diff
- name: Get/Set SUBMODULE_NAME
run: |
git diff --submodule=log --diff-filter=AM ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
SUB_NAME=$(git diff --submodule=log --diff-filter=AM ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | awk '{for (I=1;I<=NF;I++) if ($I == "Submodule") {print $(I+1)};}')
if [ -z "$SUB_NAME" ]; then
echo "Error: Could not determine submodule name"
exit 1
else
echo "SUBMODULE_NAME=$SUB_NAME" >> $GITHUB_ENV
fi
- name: Check SUBMODULE_NAME was set
if: env.SUBMODULE_NAME != ''
run: |
echo SUBMODULE_NAME: ${{ env.SUBMODULE_NAME }}
# Upload SUBMODULE_NAME as artifact to be used in other jobs
- name: Create submodule_name.txt artifact
if: env.SUBMODULE_NAME != ''
run: |
echo ${{ env.SUBMODULE_NAME }} > submodule_name.txt
- name: Upload SUBMODULE_NAME artifact
uses: actions/upload-artifact@v4
with:
name: submodule_name
path: ./submodule_name.txt
- name: Setup node
if: env.SUBMODULE_NAME != ''
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: npm install
- name: Install NR1 CLI
if: env.SUBMODULE_NAME != ''
run: curl -s https://cli.nr-ext.net/installer.sh | sudo bash
- name: NR1 Nerdpack Build
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: nr1 nerdpack:build
lint:
name: lint
needs: checkout-and-build-pr
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# Checkout submodules
# Note: Uses 8 jobs for checking out submodules quicker
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
#git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1 --recursive --jobs 8
echo "Submodules directory listing after checkout:"
if command -v tree > /dev/null; then
echo "Directory tree after submodule checkout in lint job:"
tree
else
echo "Directory listing after submodule checkout (tree not available):"
ls -R
fi
# Download submodule_name artifact
- name: Download submodule_name artifact
uses: actions/download-artifact@v4
with:
name: submodule_name
- name: List files in the current directory
run: |
if command -v tree > /dev/null; then
echo "Directory tree after artifact download:"
tree
else
echo "Directory listing after artifact download (tree not available):"
ls -R
fi
- name: Set SUBMODULE_NAME env var
run: |
SUB_NAME=$(cat submodule_name.txt)
if [ -z "$SUB_NAME" ]; then
echo "Error: Could not determine submodule name from artifact"
exit 1
else
echo "SUBMODULE_NAME=$SUB_NAME" >> $GITHUB_ENV
echo SUBMODULE_NAME: $SUB_NAME
fi
- name: Setup node
if: env.SUBMODULE_NAME != ''
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: npm install
- name: Run eslint-check
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: npm run eslint-check
test:
name: test
needs: checkout-and-build-pr
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# Checkout submodules
# Note: Uses 8 jobs for checking out submodules quicker
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
#git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1 --recursive --jobs 8
echo "Submodules directory listing after checkout:"
if command -v tree > /dev/null; then
echo "Directory tree after submodule checkout in lint job:"
tree
else
echo "Directory listing after submodule checkout (tree not available):"
ls -R
fi
# Download submodule_name artifact
- name: Download submodule_name artifact
uses: actions/download-artifact@v4
with:
name: submodule_name
- name: List files in the current directory
run: |
if command -v tree > /dev/null; then
echo "Directory tree after artifact download:"
tree
else
echo "Directory listing after artifact download (tree not available):"
ls -R
fi
- name: Set SUBMODULE_NAME env var
run: |
SUB_NAME=$(cat submodule_name.txt)
if [ -z "$SUB_NAME" ]; then
echo "Error: Could not determine submodule name from artifact"
exit 1
else
echo "SUBMODULE_NAME=$SUB_NAME" >> $GITHUB_ENV
echo SUBMODULE_NAME: $SUB_NAME
fi
- name: Setup node
if: env.SUBMODULE_NAME != ''
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: npm install
- name: Run npm test
if: env.SUBMODULE_NAME != ''
working-directory: ./${{ env.SUBMODULE_NAME }}
run: npm test
validate-catalog-nerdpack:
name: validate-catalog-requirements
needs: checkout-and-build-pr
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# Checkout submodules
# Note: Uses 8 jobs for checking out submodules quicker
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
#git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1 --recursive --jobs 8
echo "Submodules directory listing after checkout:"
if command -v tree > /dev/null; then
echo "Directory tree after submodule checkout in lint job:"
tree
else
echo "Directory listing after submodule checkout (tree not available):"
ls -R
fi
# Download submodule_name artifact
- name: Download submodule_name artifact
uses: actions/download-artifact@v4
with:
name: submodule_name
- name: List files in the current directory
run: |
if command -v tree > /dev/null; then
echo "Directory tree after artifact download:"
tree
else
echo "Directory listing after artifact download (tree not available):"
ls -R
fi
- name: Set SUBMODULE_NAME env var
run: |
SUB_NAME=$(cat submodule_name.txt)
if [ -z "$SUB_NAME" ]; then
echo "Error: Could not determine submodule name from artifact"
exit 1
else
echo "SUBMODULE_NAME=$SUB_NAME" >> $GITHUB_ENV
echo SUBMODULE_NAME: $SUB_NAME
fi
- name: Setup node
if: env.SUBMODULE_NAME != ''
uses: actions/setup-node@v4
with:
node-version: 20
# Custom action to check for OSS files
- name: compile files-present-action
if: env.SUBMODULE_NAME != ''
run: |
cd ./.github/actions/files-present-action
npm install
npm run build && npm run pack
- name: files-present-action
if: env.SUBMODULE_NAME != ''
uses: ./.github/actions/files-present-action
with:
path: ./${{ env.SUBMODULE_NAME }}
files: "README.md, .prettierrc.js, .eslintrc.js, .gitignore, package.json, LICENSE, THIRD_PARTY_NOTICES.md, cla.md, .github/ISSUE_TEMPLATE/bug_report.md, .github/ISSUE_TEMPLATE/enhancement.md, nr1.json, icon.png, catalog/config.json"