IAC-805 Lazy Load of vRO Inventory Items #257
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- "*" | |
tags-ignore: | |
- "v*" | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: {} | |
jobs: | |
build: | |
name: Node.js v${{ matrix.node-version }} on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [14.x, 16.x] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
CI: true | |
steps: | |
# - name: Set git config | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# run: git config --global core.autocrlf true | |
- uses: actions/checkout@v2 | |
- name: echo github.ref | |
run: echo ${{ github.ref }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Use NPM 8 | |
run: npm install -g [email protected] # lock to 8.3.1 until actions/setup-node#411 and npm/cli#4341 are fixed | |
- name: Set version number of package.json and build artifact | |
id: version_step | |
if: runner.os == 'macOS' | |
env: | |
RUN_NUMBER: ${{ github.run_number }} | |
run: | | |
PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
echo "version=$PACKAGE_VERSION" | |
PR_NUMBER=$(jq --raw-output ".pull_request.number" "$GITHUB_EVENT_PATH") | |
echo "prNumber=$PR_NUMBER" | |
if [ "$PR_NUMBER" != "null" ]; then | |
VERSION_STRING=${PACKAGE_VERSION}-pr${PR_NUMBER}-$(git rev-parse --short HEAD) | |
else | |
VERSION_STRING=${PACKAGE_VERSION}-nightly-$(git rev-parse --short HEAD) | |
fi | |
npm version --no-git-tag-version $VERSION_STRING | |
echo "::set-output name=version_build::${VERSION_STRING}+${RUN_NUMBER}" | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
run: | | |
echo "::set-output name=dir::$(npm config get cache)" | |
- uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}- | |
- name: Install dependencies | |
run: "npm ci" | |
- name: Lint, compile and test | |
run: "node node_modules/gulp/bin/gulp.js lint test" | |
if: runner.os != 'macOS' | |
- name: Lint, compile, test and package | |
run: "node node_modules/gulp/bin/gulp.js package" | |
if: runner.os == 'macOS' | |
- name: Publish code coverage report | |
uses: codecov/codecov-action@v1 | |
if: runner.os == 'macOS' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: "**/coverage/*.json" | |
flags: unittest | |
name: codecov | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
if: runner.os == 'macOS' | |
with: | |
name: vrealize-developer-tools-${{steps.version_step.outputs.version_build}}.vsix | |
path: "*.vsix" |