Skip to content

Commit

Permalink
Add npm build scans (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz authored Jan 21, 2025
2 parents 2dec22c + e6f332e commit 52d4223
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci-check-and-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ permissions:
jobs:
check-format-and-unit-test:
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -31,13 +32,26 @@ jobs:
with:
gradle-version: "8.12"

- name: Check formatting and compile
- name: Install npm dependencies
run: |
npm clean-install
working-directory: sources

- name: Check formatting and compile
run: |
npm run check
npm run compile
working-directory: sources
env:
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'

- name: Run unit tests
run: |
npm test
working-directory: sources
env:
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
6 changes: 5 additions & 1 deletion .github/workflows/ci-update-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ jobs:
npm run check
npm run compile
working-directory: sources

env:
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
DEVELOCITY_URL: https://ge.solutions-team.gradle.com
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Copy the generated sources/dist directory to the top-level dist
run: |
cp -r sources/dist .
Expand Down
6 changes: 6 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

cd sources

if [[ -f ~/.gradle/develocity/keys.properties ]]; then
export NODE_OPTIONS='-r @gradle/develocity-agent/preload'
export DEVELOCITY_URL=https://ge.solutions-team.gradle.com
export DEVELOCITY_ACCESS_KEY=$(paste -sd ';' ~/.gradle/develocity/keys.properties)
fi

case "$1" in
all)
npm run all
Expand Down
16 changes: 16 additions & 0 deletions sources/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"which": "5.0.0"
},
"devDependencies": {
"@gradle/develocity-agent": "https://develocity-npm-pkgs.gradle.com/gradle-develocity-agent-0.9.0.tgz",
"@types/jest": "29.5.14",
"@types/node": "20.17.14",
"@types/unzipper": "0.10.10",
Expand Down

0 comments on commit 52d4223

Please sign in to comment.