diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 794fec01c2..9031969b8e 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,9 +1,7 @@ description: Create a report to help us improve name: Bug report -title: "bug: " type: Bug -labels: ["triage"] -projects: ["penpot/8"] +labels: ["needs triage"] body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 0fe9c3757d..17f451ae3f 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,9 +1,7 @@ description: Suggest an idea for this project. labels: ["needs triage"] name: "Feature request" -title: "feature: " type: Enhancement -projects: ["penpot/8"] body: - type: markdown diff --git a/.github/workflows/build-docker-devenv.yml b/.github/workflows/build-docker-devenv.yml index 53b5cf67ef..f94064833e 100644 --- a/.github/workflows/build-docker-devenv.yml +++ b/.github/workflows/build-docker-devenv.yml @@ -38,3 +38,13 @@ jobs: tags: ${{ env.DOCKER_IMAGE }}:latest cache-from: type=registry,ref=${{ env.DOCKER_IMAGE }}:buildcache cache-to: type=registry,ref=${{ env.DOCKER_IMAGE }}:buildcache,mode=max + + - name: Notify Mattermost + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }} + MATTERMOST_CHANNEL: bot-alerts-cicd + TEXT: | + 🚀 *[PENPOT] New devenv available* + 📄 You may want to update your devenv. + @alvaro diff --git a/.github/workflows/tests-backend.yml b/.github/workflows/tests-backend.yml new file mode 100644 index 0000000000..fb58ed7ea4 --- /dev/null +++ b/.github/workflows/tests-backend.yml @@ -0,0 +1,84 @@ +name: "CI: Backend" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'backend/**' + - 'common/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'backend/**' + - 'common/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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: Lint + working-directory: ./backend + run: | + corepack enable; + corepack install; + pnpm install; + pnpm run check-fmt + pnpm run lint + + - name: 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 diff --git a/.github/workflows/tests-common.yml b/.github/workflows/tests-common.yml new file mode 100644 index 0000000000..5996c82742 --- /dev/null +++ b/.github/workflows/tests-common.yml @@ -0,0 +1,57 @@ +name: "CI: Common" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'common/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'common/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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: Lint + 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: Tests + working-directory: ./common + run: | + ./scripts/test diff --git a/.github/workflows/tests-frontend.yml b/.github/workflows/tests-frontend.yml new file mode 100644 index 0000000000..14011a5110 --- /dev/null +++ b/.github/workflows/tests-frontend.yml @@ -0,0 +1,71 @@ +name: "CI: Frontend" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'frontend/**' + - 'common/**' + - 'render-wasm/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'frontend/**' + - 'common/**' + - 'render-wasm/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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: Lint + 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: Unit Tests + working-directory: ./frontend + run: | + ./scripts/test + + - name: Component Tests + working-directory: ./frontend + env: + VITEST_BROWSER_TIMEOUT: 120000 + run: | + ./scripts/test-components diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml new file mode 100644 index 0000000000..b028676aa7 --- /dev/null +++ b/.github/workflows/tests-integration.yml @@ -0,0 +1,93 @@ +name: "CI: Integration" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'frontend/**' + - 'common/**' + - 'render-wasm/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'frontend/**' + - 'common/**' + - 'render-wasm/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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: + if: ${{ !github.event.pull_request.draft }} + name: "Integration 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 + + 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 + + - name: Upload test result + uses: actions/upload-artifact@v7 + if: always() + with: + name: integration-tests-result + path: frontend/test-results/ + overwrite: true + retention-days: 3 diff --git a/.github/workflows/tests-library.yml b/.github/workflows/tests-library.yml new file mode 100644 index 0000000000..4c84965f4c --- /dev/null +++ b/.github/workflows/tests-library.yml @@ -0,0 +1,58 @@ +name: "CI: Library" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'common/**' + - 'library/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'common/**' + - 'library/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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: Lint + working-directory: ./library + run: | + corepack enable; + corepack install; + pnpm install; + pnpm run check-fmt + pnpm run lint + + - name: Tests + working-directory: ./library + run: | + ./scripts/test diff --git a/.github/workflows/tests-mcp.yml b/.github/workflows/tests-mcp.yml index 0ab2909b72..9e622ca83a 100644 --- a/.github/workflows/tests-mcp.yml +++ b/.github/workflows/tests-mcp.yml @@ -45,3 +45,8 @@ jobs: pnpm run fmt:check; pnpm -r run build; pnpm -r run types:check; + + - name: Tests + working-directory: ./mcp + run: | + pnpm -r run test; diff --git a/.github/workflows/tests-plugins.yml b/.github/workflows/tests-plugins.yml new file mode 100644 index 0000000000..5cc161461c --- /dev/null +++ b/.github/workflows/tests-plugins.yml @@ -0,0 +1,83 @@ +name: "CI: Plugins" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'plugins/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'plugins/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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 diff --git a/.github/workflows/tests-wasm.yml b/.github/workflows/tests-wasm.yml new file mode 100644 index 0000000000..424d4f908f --- /dev/null +++ b/.github/workflows/tests-wasm.yml @@ -0,0 +1,57 @@ +name: "CI: WASM" + +defaults: + run: + shell: bash + +on: + pull_request: + paths: + - 'render-wasm/**' + + types: + - opened + - synchronize + - ready_for_review + + push: + branches: + - develop + - staging + + paths: + - 'render-wasm/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + 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