Skip to content

Fix(auth-bloc): make auth-block queries indepence from postgres to sqlite #76

Fix(auth-bloc): make auth-block queries indepence from postgres to sqlite

Fix(auth-bloc): make auth-block queries indepence from postgres to sqlite #76

name: Test Format Lint
on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
project: ${{ steps.filter.outputs.project }}
steps:
- uses: actions/checkout@v4
- id: 'getBranch'
run: |
if [[ $GITHUB_REF_NAME == 'master' ]]; then
echo "test=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
else
echo "test='HEAD'" >> "$GITHUB_OUTPUT"
fi
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: pnpm i && npm run format && npm run lint
- uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
skip_dirty_check: false
- uses: dorny/paths-filter@v3
if: steps.auto-commit-action.outputs.changes_detected == 'false'
id: filter
with:
base: ${{ steps.getBranch.outputs.test }}
filters: |
project:
- 'src/**'
- 'mail/**'
- 'page/**'
- 'pnpm-lock.yaml'
Test_service:
needs: changes
if: ${{ needs.changes.outputs.project == 'true' }}
name: 'Test Services'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ikalnytskyi/action-setup-postgres@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: npm run prebuild:dev && npm run test:service
- uses: actions/upload-artifact@v4
with:
name: service
path: |
./reports/service.xml
./coverage/service.txt
Test_resolver:
needs: changes
if: ${{ needs.changes.outputs.project == 'true' }}
name: 'Test resolvers'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ikalnytskyi/action-setup-postgres@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: npm run prebuild:dev && npm run test:resolver
- uses: actions/upload-artifact@v4
with:
name: resolver
path: |
./reports/resolver.xml
./coverage/resolver.txt
Test_controller:
needs: changes
if: ${{ needs.changes.outputs.project == 'true' }}
name: 'Test controllers'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ikalnytskyi/action-setup-postgres@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: npm run prebuild:dev && npm run test:controller
- uses: actions/upload-artifact@v4
with:
name: controller
path: |
./reports/controller.xml
./coverage/controller.txt
Test_etc:
needs: changes
if: ${{ needs.changes.outputs.project == 'true' }}
name: 'Test the rest'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ikalnytskyi/action-setup-postgres@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: npm run prebuild:dev && npm run test:etc
- uses: actions/upload-artifact@v4
with:
name: etc
path: |
./reports/etc.xml
Test_web:
needs: changes
if: ${{ needs.changes.outputs.project == 'true' }}
name: 'Test web'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: supercharge/redis-github-action@1.8.0
with:
redis-password: ''
- uses: ikalnytskyi/action-setup-postgres@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: 'pnpm'
- run: rm -fr public/* && npm run genkey
- run: npm run start:ci
FormatAndLint:
needs:
- Test_service
- Test_resolver
- Test_controller
- Test_web
- Test_etc
name: 'Format & Lint'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Delete GitHub Actions Comments
uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ github.token }}
delete_user_name: 'github-actions[bot]'
issue_number: ${{ github.event.number }}
- uses: actions/download-artifact@v4
- name: Controller
uses: MishaKav/jest-coverage-comment@main
with:
title: Controller test result
coverage-path: ./controller/coverage/controller.txt
create-new-comment: true
junitxml-path: ./controller/reports/controller.xml
- name: Resolver
uses: MishaKav/jest-coverage-comment@main
with:
title: Resolver test result
coverage-path: ./resolver/coverage/resolver.txt
create-new-comment: true
junitxml-path: ./resolver/reports/resolver.xml
- name: Service
uses: MishaKav/jest-coverage-comment@main
with:
title: Service test result
coverage-path: ./service/coverage/service.txt
create-new-comment: true
junitxml-path: ./service/reports/service.xml