refactor(auth): redesign authentication and identity models #87
Workflow file for this run
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: CI | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backendChanged: ${{ steps.detect.outputs.backendChanged }} | |
| mobileChanged: ${{ steps.detect.outputs.mobileChanged }} | |
| webChanged: ${{ steps.detect.outputs.webChanged }} | |
| backendFiles: ${{ steps.detect.outputs.backendFiles }} | |
| mobileFiles: ${{ steps.detect.outputs.mobileFiles }} | |
| webFiles: ${{ steps.detect.outputs.webFiles }} | |
| backendTests: ${{ steps.detect.outputs.backendTests }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Detect changed files | |
| id: detect | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const script = require('./.github/scripts/ciScript.js'); | |
| return await script({ github, context, core }); | |
| backend-ci: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.backendChanged == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend_lint: ${{ steps.backend_lint.outcome }} | |
| backend_test: ${{ steps.backend_test.outcome }} | |
| backend_typecheck: ${{ steps.backend_typecheck.outcome }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v6.0.8 | |
| - run: pnpm install | |
| - name: Backend lint | |
| id: backend_lint | |
| continue-on-error: true | |
| run: cd apps/backend && pnpm eslint ${{ needs.detect-changes.outputs.backendFiles }} | |
| - name: Backend test | |
| id: backend_test | |
| continue-on-error: true | |
| run: cd apps/backend && pnpm test ${{ needs.detect-changes.outputs.backendTests }} | |
| - name: Backend typecheck | |
| id: backend_typecheck | |
| continue-on-error: true | |
| run: cd apps/backend && pnpm typecheck ${{ needs.detect-changes.outputs.backendFiles }} | |
| - name: Fail backend if checks failed | |
| if: steps.backend_lint.outcome == 'failure' || steps.backend_test.outcome == 'failure' || steps.backend_typecheck.outcome == 'failure' | |
| run: exit 1 | |
| web-ci: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.webChanged == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| web_check: ${{ steps.web_check.outcome }} | |
| web_build: ${{ steps.web_build.outcome }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v6.0.8 | |
| - run: pnpm install | |
| - name: Web check | |
| id: web_check | |
| continue-on-error: true | |
| run: cd apps/web && pnpm check | |
| - name: Web build | |
| id: web_build | |
| continue-on-error: true | |
| run: cd apps/web && pnpm build | |
| - name: Fail web if checks failed | |
| if: steps.web_check.outcome == 'failure' || steps.web_build.outcome == 'failure' | |
| run: exit 1 | |
| mobile-ci: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.mobileChanged == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| mobile_lint: ${{ steps.mobile_lint.outcome }} | |
| mobile_test: ${{ steps.mobile_test.outcome }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v6.0.8 | |
| - run: pnpm install | |
| - name: Mobile lint | |
| id: mobile_lint | |
| continue-on-error: true | |
| run: cd apps/mobile && pnpm eslint ${{ needs.detect-changes.outputs.mobileFiles }} | |
| - name: Mobile test | |
| id: mobile_test | |
| continue-on-error: true | |
| run: cd apps/mobile && pnpm test | |
| - name: Fail mobile if checks failed | |
| if: steps.mobile_lint.outcome == 'failure' || steps.mobile_test.outcome == 'failure' | |
| run: exit 1 | |
| comment-results: | |
| needs: | |
| - backend-ci | |
| - web-ci | |
| - mobile-ci | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Comment results | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const script = require('./.github/scripts/commentResults.js'); | |
| await script({ | |
| github, | |
| context, | |
| backend: '${{ needs.backend-ci.result }}', | |
| web: '${{ needs.web-ci.result }}', | |
| mobile: '${{ needs.mobile-ci.result }}', | |
| backendLint: '${{ needs.backend-ci.outputs.backend_lint }}', | |
| backendTest: '${{ needs.backend-ci.outputs.backend_test }}', | |
| backendTypecheck: '${{ needs.backend-ci.outputs.backend_typecheck }}', | |
| mobileLint: '${{ needs.mobile-ci.outputs.mobile_lint }}', | |
| mobileTest: '${{ needs.mobile-ci.outputs.mobile_test }}', | |
| webCheck: '${{ needs.web-ci.outputs.web_check }}', | |
| webBuild: '${{ needs.web-ci.outputs.web_build }}' | |
| }); |