feat: update deps #583
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: Check PR | |
on: | |
pull_request: | |
branches: [ prod, staging ] | |
types: [ opened, synchronize ] | |
jobs: | |
changed-microservices: | |
name: Get changed microservices | |
runs-on: ubuntu-latest | |
outputs: | |
microservices: ${{ steps.microservices.outputs.list }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v42 | |
with: | |
json: true | |
dir_names: true | |
dir_names_max_depth: 3 | |
- id: microservices | |
run: npx @lomray/microservices-cli changed-microservices | |
env: | |
FILES: '${{ steps.changed-files.outputs.all_changed_files }}' | |
prtitle: | |
name: Check PR title | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Commit lint | |
run: | | |
npm install [email protected] @commitlint/[email protected] | |
echo "${{ github.event.pull_request.title }}" | npx --no-install commitlint -g commitlint.config.js | |
checks: | |
name: Run code checks | |
needs: changed-microservices | |
runs-on: ubuntu-latest | |
if: needs.changed-microservices.outputs.microservices != '' | |
strategy: | |
matrix: | |
microservice: ${{ fromJson(needs.changed-microservices.outputs.microservices) }} | |
env: | |
MICROSERVICE_NAME: ${{ matrix.microservice }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | |
- name: Install global dependencies | |
run: npm ci | |
- name: Install microservice dependencies | |
run: npx @lomray/microservices-cli global-install | |
env: | |
ONLY: ${{ env.MICROSERVICE_NAME }} | |
- name: Check microservice eslint | |
run: npx @lomray/microservices-cli lint | |
env: | |
ONLY: ${{ env.MICROSERVICE_NAME }} | |
- name: Check microservice typescript | |
run: npx @lomray/microservices-cli ts-check | |
env: | |
ONLY: ${{ env.MICROSERVICE_NAME }} | |
- name: Run microservices tests | |
run: npx @lomray/microservices-cli test | |
env: | |
ONLY: ${{ env.MICROSERVICE_NAME }} | |
sonarcube: | |
name: Sonarcube | |
needs: [changed-microservices] | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.ref }}-sonarcube | |
cancel-in-progress: true | |
strategy: | |
matrix: | |
microservice: ${{ fromJson(needs.changed-microservices.outputs.microservices) }} | |
env: | |
MICROSERVICE_NAME: ${{ matrix.microservice }} | |
WORK_DIR: "microservices/${{ matrix.microservice }}" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }} | |
with: | |
projectBaseDir: ${{ env.WORK_DIR }} |