summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-02-05 17:59:54 +0300
committerValentin Popov <valentin@popov.link>2026-02-05 17:59:54 +0300
commit9f719916b0444b1892e91f29db3ed40da453b62f (patch)
tree82d6249627b2001a5024c505c4d489124676aa0e
parent4ad17021e4e58432c9eadc0ee2bff7fb24ad1148 (diff)
downloadstrapi-plugin-checkbox-list-9f719916b0444b1892e91f29db3ed40da453b62f.tar.xz
strapi-plugin-checkbox-list-9f719916b0444b1892e91f29db3ed40da453b62f.zip
Add Gitea workflow for testing and E2E integration
- Created a new workflow file (.gitea/workflows/test.yml) to automate testing processes. - Defined jobs for basic testing and end-to-end (E2E) testing using Jest, Supertest, and Playwright/Cypress. - Included steps for dependency installation, plugin building, and Strapi server management during E2E tests.
-rw-r--r--.gitea/workflows/test.yml87
1 files changed, 87 insertions, 0 deletions
diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml
new file mode 100644
index 0000000..25e745e
--- /dev/null
+++ b/.gitea/workflows/test.yml
@@ -0,0 +1,87 @@
+name: Test
+
+on:
+ pull_request:
+ workflow_dispatch:
+
+jobs:
+ test:
+ name: Basic
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "npm"
+ cache-dependency-path: |
+ package-lock.json
+ playground/package-lock.json
+ - name: Install root deps
+ run: npm ci
+ - name: Build plugin
+ run: npm run build
+ - name: Verify plugin
+ run: npm run verify
+ - name: Pack plugin into playground .yalc
+ run: |
+ TARBALL=$(npm pack --silent)
+ mkdir -p playground/.yalc/strapi-plugin-checkbox-list
+ tar -xzf "$TARBALL" -C playground/.yalc/strapi-plugin-checkbox-list --strip-components=1
+ - name: Install playground deps
+ run: npm ci --prefix playground
+ - name: Build playground
+ run: npm run build --prefix playground
+ - name: Integration tests (Jest + Supertest)
+ run: npm run test:integration --prefix playground
+
+ e2e:
+ name: E2E
+ runs-on: ubuntu-latest
+ needs: test
+ env:
+ STRAPI_ADMIN_EMAIL: admin@example.com
+ STRAPI_ADMIN_PASSWORD: Admin12345
+ STRAPI_ADMIN_FIRSTNAME: Admin
+ STRAPI_ADMIN_LASTNAME: User
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "npm"
+ cache-dependency-path: |
+ package-lock.json
+ playground/package-lock.json
+ - name: Install root deps
+ run: npm ci
+ - name: Build plugin
+ run: npm run build
+ - name: Pack plugin into playground .yalc
+ run: |
+ TARBALL=$(npm pack --silent)
+ mkdir -p playground/.yalc/strapi-plugin-checkbox-list
+ tar -xzf "$TARBALL" -C playground/.yalc/strapi-plugin-checkbox-list --strip-components=1
+ - name: Install playground deps
+ run: npm ci --prefix playground
+ - name: Create admin user
+ run: |
+ cd playground
+ npx strapi admin:create-user \
+ --email "$STRAPI_ADMIN_EMAIL" \
+ --password "$STRAPI_ADMIN_PASSWORD" \
+ --firstname "$STRAPI_ADMIN_FIRSTNAME" \
+ --lastname "$STRAPI_ADMIN_LASTNAME"
+ - name: Start Strapi
+ run: |
+ npm run develop --prefix playground -- --host 0.0.0.0 --port 1337 &
+ echo $! > /tmp/strapi.pid
+ until curl -sSf http://127.0.0.1:1337/admin >/dev/null; do sleep 2; done
+ - name: E2E tests (Playwright/Cypress)
+ run: npm run e2e --prefix playground
+ - name: Stop Strapi
+ if: always()
+ run: |
+ if [ -f /tmp/strapi.pid ]; then
+ kill "$(cat /tmp/strapi.pid)" || true
+ fi