Update CI pipeline #71
This file contains hidden or 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: PR Code review | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| # Define the primary Node.js version for release, build, coverage uploads and badge generation | |
| PRIMARY_NODE_VERSION: '25' | |
| jobs: | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up runtime - Node.js ${{ env.PRIMARY_NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Validate dependency file | |
| run: npm install --dry-run | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run JS/TS lint (eslint, prettier) | |
| run: npm run lint:all | |
| tests: | |
| name: Test on Node.js ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 22.x, 24.x] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up runtime - Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install OpenAPI Generator CLI | |
| run: npm run spec:generate:install | |
| - name: Generate OpenAPI client | |
| run: npm run spec:generate | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| doc: | |
| name: Generate Documentation | |
| runs-on: ubuntu-latest | |
| needs: [ tests ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/workflows/actions/doc | |
| with: | |
| default-runtime-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| coverage: | |
| name: Code Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: [ tests ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/workflows/actions/coverage | |
| if: false | |
| with: | |
| default-runtime-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| codecov-secret: ${{ secrets.CODECOV_TOKEN || 'Please define a CODECOV_TOKEN in your GitHub envVars' }} | |
| build: | |
| name: Build Project | |
| runs-on: ubuntu-latest | |
| needs: [ coverage, quality ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up runtime - Node.js ${{ env.PRIMARY_NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install OpenAPI Generator CLI | |
| run: npm run spec:generate:install | |
| - name: Generate OpenAPI client | |
| run: npm run spec:generate | |
| - name: Build project | |
| run: npm run build |