move creator-hub to packages/@dcl #60
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: Creator Hub CI/CD | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - experimental | |
| pull_request: | |
| release: | |
| types: | |
| - created | |
| concurrency: | |
| group: creator-hub-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| WORKING_DIRECTORY: packages/@dcl/creator-hub | |
| jobs: | |
| # ============================================================================ | |
| # Code Quality Jobs | |
| # ============================================================================ | |
| lint: | |
| name: Lint & Code Style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
| - name: Run ESLint | |
| run: npm run lint --if-present | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| - name: Check code style with Prettier | |
| run: | | |
| npm i prettier | |
| npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}" | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| typechecking: | |
| name: TypeScript Type Checking | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
| - name: Run TypeScript type checking | |
| run: npm run typecheck --if-present | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| # ============================================================================ | |
| # Testing Jobs | |
| # ============================================================================ | |
| tests: | |
| name: Run Tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ macos-latest, windows-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
| - name: Run main tests | |
| run: npm run test:main --if-present | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| - name: Run preload tests | |
| run: npm run test:preload --if-present | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| - name: Run renderer tests | |
| run: npm run test:renderer --if-present | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| - name: Run E2E tests | |
| if: env.ENABLE_E2E_TESTS == 'true' | |
| run: npm run build && npx vitest run | |
| working-directory: ${{ env.WORKING_DIRECTORY }} | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=8192" | |
| ENABLE_E2E_TESTS: true |