refactor: extracts certificate validation into a separate class #1437
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: Validate and Build API | |
on: | |
pull_request: | |
branches: ["main"] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
validate-n-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check for changes | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
api: | |
- 'apps/api/**' | |
- name: Setup Node.js | |
if: steps.filter.outputs.api == 'true' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.14.0 | |
- name: Restore root node_modules cache | |
if: steps.filter.outputs.api == 'true' | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: | | |
node_modules | |
apps/api/node_modules | |
packages/*/node_modules | |
key: api-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.filter.outputs.api == 'true' && steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Run static code analysis | |
if: steps.filter.outputs.api == 'true' | |
run: npm run lint:api | |
- name: Run tests | |
if: steps.filter.outputs.api == 'true' | |
env: | |
POSTGRES_SKIP_IMPORT: true | |
run: | | |
npm run dc:up:db | |
npm run test:cov --workspace=apps/api | |
npm run dc:down | |
- name: Build the Docker image for API | |
if: steps.filter.outputs.api == 'true' | |
run: packages/docker/script/dc.sh build api | |
- name: Upload Test Coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
directory: ./apps/api/coverage | |
flags: api | |
token: ${{ secrets.CODECOV_TOKEN }} |