From 24b715d676d9af4861fd3e0bf72f7f8bafc31f0d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 5 Aug 2026 17:31:06 +0300 Subject: [PATCH] reorganize our CI stuff --- .woodpecker/build.yaml | 25 -------------------- .woodpecker/code-analisys.yaml | 42 ++++++++++++++++++++++++++++++++++ .woodpecker/test-e2e.yaml | 4 ++++ .woodpecker/test.yaml | 17 +++----------- package.json | 3 ++- 5 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 .woodpecker/code-analisys.yaml diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index af0bb98e3..5353344d1 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -6,10 +6,6 @@ when: - event: manual branch: ${CI_REPO_DEFAULT_BRANCH} -depends_on: - - test - - test-e2e - labels: platform: linux/amd64 memory: 'high' @@ -18,26 +14,5 @@ steps: build: image: docker.io/node:20-alpine commands: - - apk add --no-cache zip git - yarn --frozen-lockfile - yarn build - - if [ "${CI_PIPELINE_EVENT}" = "push" ] || [ "${CI_PIPELINE_EVENT}" = "manual" ]; then zip -9qr ${CI_REPO_DEFAULT_BRANCH}.zip dist/; fi - - upload-artifacts: - image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0 - when: - - event: push - branch: ${CI_REPO_DEFAULT_BRANCH} - - event: manual - branch: ${CI_REPO_DEFAULT_BRANCH} - settings: - user: - from_secret: pleroma-ci-user - password: - from_secret: pleroma-ci-password - update: true - owner: 'pleroma' - package_name: 'pleroma-fe-builds' - package_version: ${CI_REPO_DEFAULT_BRANCH} - file_source: ./${CI_REPO_DEFAULT_BRANCH}.zip - file_name: latest.zip diff --git a/.woodpecker/code-analisys.yaml b/.woodpecker/code-analisys.yaml new file mode 100644 index 000000000..deee51543 --- /dev/null +++ b/.woodpecker/code-analisys.yaml @@ -0,0 +1,42 @@ +when: + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} + - event: manual + branch: ${CI_REPO_DEFAULT_BRANCH} + +labels: + platform: linux/amd64 + memory: 'high' + +depends_on: + - build + - test + - test-e2e + +clone: + depth: 0 + +variables: + script_file_entrypoint: &script_file_entrypoint + - /bin/sh + - -c + - 'printf "%s" "$CI_SCRIPT" | base64 -d > /tmp/ci-script.sh && /bin/sh -xe /tmp/ci-script.sh' + +steps: + # Needed to generate coverage + test: + image: mcr.microsoft.com/playwright:v1.61.0-jammy + environment: + FF_NETWORK_PER_BUILD: "true" + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" + entrypoint: *script_file_entrypoint + commands: + - yarn --frozen-lockfile + - yarn unit-ci-coverage + + code-analysis: + image: sonarsource/sonar-scanner-cli:11 + environment: + SONAR_TOKEN: + from_secret: sonarqube-token + entrypoint: sonar-scanner diff --git a/.woodpecker/test-e2e.yaml b/.woodpecker/test-e2e.yaml index 2a7d1511d..8f7e407f8 100644 --- a/.woodpecker/test-e2e.yaml +++ b/.woodpecker/test-e2e.yaml @@ -10,6 +10,10 @@ labels: platform: linux/amd64 memory: 'high' +depends_on: + - build + - test + variables: artifacts_uploader_settings: &artifacts_uploader_settings user: diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 9c3c24a53..c3f2c3793 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -10,6 +10,9 @@ labels: platform: linux/amd64 memory: 'high' +depends_on: + - build + variables: artifacts_uploader_settings: &artifacts_uploader_settings user: @@ -45,20 +48,6 @@ steps: exit 1 fi - code-analysis: - image: sonarsource/sonar-scanner-cli:11 - when: - - event: push - branch: ${CI_REPO_DEFAULT_BRANCH} - - event: manual - branch: ${CI_REPO_DEFAULT_BRANCH} - environment: - SONAR_TOKEN: - from_secret: sonarqube-token - entrypoint: *script_file_entrypoint - commands: - - sonar-scanner - upload-artifacts: image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0 when: diff --git a/package.json b/package.json index f8bacaf15..50138e6a2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "dev": "node build/update-emoji.js && vite dev", "build": "node build/update-emoji.js && vite build", "unit": "node build/update-emoji.js && vitest --run --coverage", - "unit-ci": "node build/update-emoji.js && vitest --run --coverage --browser.headless", + "unit-ci": "node build/update-emoji.js && vitest --run --browser.headless", + "unit-ci-coverage": "node build/update-emoji.js && vitest --run --coverage --browser.headless", "unit:watch": "node build/update-emoji.js && vitest --coverage", "e2e:pw": "playwright test --config test/e2e-playwright/playwright.config.mjs", "e2e": "sh ./tools/e2e/run.sh",