Fix image upload issue to do with empty no images to upload and the b… #48
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: Pull Request Microservices | |
on: | |
pull_request: | |
types: | |
- "opened" | |
- "reopened" | |
- "synchronize" | |
- "closed" | |
branches: [main, development] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}-pull-requests | |
cancel-in-progress: true | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
apps: ${{ steps.filter.outputs.changes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
token: ${{ github.token }} | |
filters: | | |
accounts: | |
- "apps/accounts/**" | |
advertisements: | |
- "apps/advertisements/**" | |
messages: | |
- "apps/messages/**" | |
gateway: | |
- "apps/gateway/**" | |
lint: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: needs.changes.outputs.apps != '[]' | |
strategy: | |
matrix: | |
app: ${{ fromJSON(needs.changes.outputs.apps) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install Node.js dependencies | |
run: npm ci -w apps/${{ matrix.app }} | |
- name: Run linters ${{ matrix.app }} | |
run: npm run lint -w apps/${{ matrix.app }} --if-present | |
test: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: needs.changes.outputs.apps != '[]' | |
strategy: | |
matrix: | |
app: ${{ fromJSON(needs.changes.outputs.apps) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install Node.js dependencies | |
run: npm ci -w apps/${{ matrix.app }} | |
- name: Run Tests ${{ matrix.app }} | |
run: npm run test -w apps/${{ matrix.app }} --if-present |