gradle/.github/workflows/ci-check-and-unit-test.yml
2026-02-02 14:18:21 -07:00

61 lines
1.7 KiB
YAML

name: CI-check-and-unit-test
on:
push:
branches:
- 'main'
- 'release/**'
paths-ignore:
- 'dist/**'
pull_request:
permissions:
contents: read
jobs:
check-format-and-unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 24
cache: npm
cache-dependency-path: sources/package-lock.json
- name: Install Develocity npm agent
run: |
npm exec -y -- pacote extract @gradle-tech/develocity-agent@3.0.1 ~/.node_libraries/@gradle-tech/develocity-agent
- name: Setup Gradle
# Use a released version to avoid breakages
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
env:
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
with:
gradle-version: '8.14.2'
- 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-tech/develocity-agent/preload'
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
- name: Run unit tests
run: |
npm test
working-directory: sources
env:
NODE_OPTIONS: '-r @gradle-tech/develocity-agent/preload'
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'