diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 4bbe6ddd3b..0000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,411 +0,0 @@ -name: "CI" - -defaults: - run: - shell: bash - -on: - pull_request: - types: - - opened - - synchronize - - ready_for_review - push: - branches: - - develop - - staging - -concurrency: - group: ${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - lint: - if: ${{ !github.event.pull_request.draft }} - name: "Linter" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Lint Common - working-directory: ./common - run: | - corepack enable; - corepack install; - pnpm install; - pnpm run check-fmt:clj - pnpm run check-fmt:js - pnpm run lint:clj - - - name: Lint Frontend - working-directory: ./frontend - run: | - corepack enable; - corepack install; - pnpm install; - pnpm run check-fmt:js - pnpm run check-fmt:clj - pnpm run check-fmt:scss - pnpm run lint:clj - pnpm run lint:js - pnpm run lint:scss - - - name: Lint Backend - working-directory: ./backend - run: | - corepack enable; - corepack install; - pnpm install; - pnpm run check-fmt - pnpm run lint - - - name: Lint Exporter - working-directory: ./exporter - run: | - corepack enable; - corepack install; - pnpm install; - pnpm run check-fmt - pnpm run lint - - - name: Lint Library - working-directory: ./library - run: | - corepack enable; - corepack install; - pnpm install; - pnpm run check-fmt - pnpm run lint - - test-common: - if: ${{ !github.event.pull_request.draft }} - name: "Common Tests" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Run tests - working-directory: ./common - run: | - ./scripts/test - - test-plugins: - if: ${{ !github.event.pull_request.draft }} - name: Plugins Runtime Linter & Tests - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - uses: actions/checkout@v6 - - - name: Setup Node - id: setup-node - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - - name: Install deps - working-directory: ./plugins - shell: bash - run: | - corepack enable; - corepack install; - pnpm install; - - - name: Run Lint - working-directory: ./plugins - run: pnpm run lint - - - name: Run Format Check - working-directory: ./plugins - run: pnpm run format:check - - - name: Run Test - working-directory: ./plugins - run: pnpm run test - - - name: Build runtime - working-directory: ./plugins - run: pnpm run build:runtime - - - name: Build doc - working-directory: ./plugins - run: pnpm run build:doc - - - name: Build plugins - working-directory: ./plugins - run: pnpm run build:plugins - - - name: Build styles - working-directory: ./plugins - run: pnpm run build:styles-example - - test-frontend: - if: ${{ !github.event.pull_request.draft }} - name: "Frontend Tests" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Unit Tests - working-directory: ./frontend - run: | - ./scripts/test - - - name: Component Tests - working-directory: ./frontend - env: - VITEST_BROWSER_TIMEOUT: 120000 - run: | - ./scripts/test-components - - test-render-wasm: - if: ${{ !github.event.pull_request.draft }} - name: "Render WASM Tests" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Format - working-directory: ./render-wasm - run: | - cargo fmt --check - - - name: Lint - working-directory: ./render-wasm - run: | - ./lint - - - name: Test - working-directory: ./render-wasm - run: | - ./test - - test-backend: - if: ${{ !github.event.pull_request.draft }} - name: "Backend Tests" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - services: - postgres: - image: postgres:17 - # Provide the password for postgres - env: - POSTGRES_USER: penpot_test - POSTGRES_PASSWORD: penpot_test - POSTGRES_DB: penpot_test - - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - redis: - image: valkey/valkey:9 - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Run tests - working-directory: ./backend - env: - PENPOT_TEST_DATABASE_URI: "postgresql://postgres/penpot_test" - PENPOT_TEST_DATABASE_USERNAME: penpot_test - PENPOT_TEST_DATABASE_PASSWORD: penpot_test - PENPOT_TEST_REDIS_URI: "redis://redis/1" - - run: | - mkdir -p /tmp/penpot; - clojure -M:dev:test --reporter kaocha.report/documentation - - test-library: - if: ${{ !github.event.pull_request.draft }} - name: "Library Tests" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Run tests - working-directory: ./library - run: | - ./scripts/test - - build-integration: - if: ${{ !github.event.pull_request.draft }} - name: "Build Integration Bundle" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Build Bundle - working-directory: ./frontend - run: | - ./scripts/build - - - name: Store Bundle Cache - uses: actions/cache@v5 - with: - key: "integration-bundle-${{ github.sha }}" - path: frontend/resources/public - - test-integration-1: - if: ${{ !github.event.pull_request.draft }} - name: "Integration Tests 1/3" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - needs: build-integration - - steps: - - name: Checkout Repository - uses: actions/checkout@v6 - - - name: Restore Cache - uses: actions/cache/restore@v5 - with: - key: "integration-bundle-${{ github.sha }}" - path: frontend/resources/public - - - name: Run Tests - working-directory: ./frontend - run: | - ./scripts/test-e2e --shard="1/3"; - - - name: Upload test result - uses: actions/upload-artifact@v7 - if: always() - with: - name: integration-tests-result-1 - path: frontend/test-results/ - overwrite: true - retention-days: 3 - - test-integration-2: - if: ${{ !github.event.pull_request.draft }} - name: "Integration Tests 2/3" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - needs: build-integration - - steps: - - name: Checkout Repository - uses: actions/checkout@v6 - - - name: Restore Cache - uses: actions/cache/restore@v5 - with: - key: "integration-bundle-${{ github.sha }}" - path: frontend/resources/public - - - name: Run Tests - working-directory: ./frontend - run: | - ./scripts/test-e2e --shard="2/3"; - - - name: Upload test result - uses: actions/upload-artifact@v7 - if: always() - with: - name: integration-tests-result-2 - path: frontend/test-results/ - overwrite: true - retention-days: 3 - - test-integration-3: - if: ${{ !github.event.pull_request.draft }} - name: "Integration Tests 3/3" - runs-on: penpot-runner-02 - container: - image: penpotapp/devenv:latest - volumes: - - /var/cache/github-runner/m2:/root/.m2 - - /var/cache/github-runner/gitlib:/root/.gitlibs - - needs: build-integration - - steps: - - name: Checkout Repository - uses: actions/checkout@v6 - - - name: Restore Cache - uses: actions/cache/restore@v5 - with: - key: "integration-bundle-${{ github.sha }}" - path: frontend/resources/public - - - name: Run Tests - working-directory: ./frontend - run: | - ./scripts/test-e2e --shard="3/3"; - - - name: Upload test result - uses: actions/upload-artifact@v7 - if: always() - with: - name: integration-tests-result-3 - path: frontend/test-results/ - overwrite: true - retention-days: 3