Spaces:
Build error
Build error
| name: CI Emails | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| changed-files-check: | |
| uses: ./.github/workflows/changed-files.yaml | |
| with: | |
| files: | | |
| package.json | |
| packages/twenty-emails/** | |
| emails-test: | |
| needs: changed-files-check | |
| if: needs.changed-files-check.outputs.any_changed == 'true' | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch custom Github Actions and base branch history | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 10 | |
| - name: Install dependencies | |
| uses: ./.github/actions/yarn-install | |
| - name: Build twenty-emails | |
| run: npx nx build twenty-emails | |
| - name: Extract translations (lingui) | |
| run: npx nx run twenty-emails:lingui:extract | |
| - name: Compile translations (lingui) | |
| run: npx nx run twenty-emails:lingui:compile | |
| - name: Run email tests | |
| run: | | |
| # Start the email server in the background | |
| npx nx run twenty-emails:start & | |
| SERVER_PID=$! | |
| # Wait for server to start | |
| sleep 20 | |
| # Check if server is running | |
| if ! curl -s http://localhost:4001/preview/test.email > /dev/null; then | |
| echo "Email server failed to start" | |
| kill $SERVER_PID | |
| exit 1 | |
| fi | |
| # Kill the server | |
| kill $SERVER_PID | |
| ci-emails-status-check: | |
| if: always() && !cancelled() | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| needs: [changed-files-check, emails-test] | |
| steps: | |
| - name: Fail job if any needs failed | |
| if: contains(needs.*.result, 'failure') | |
| run: exit 1 | |