fix: a partly stale batch delete is not a success #575
Workflow file for this run
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: sysPass CI | |
| on: | |
| push: | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| unit: | |
| name: Unit tests (${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: pdo_mysql, gd, ldap, gettext, zip, intl, mbstring | |
| coverage: none | |
| ini-values: zend.assertions=1, memory_limit=-1 | |
| - name: Setup locales | |
| uses: ./.github/actions/setup-locales | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v4 | |
| with: | |
| composer-options: --prefer-dist | |
| - name: Run unit tests | |
| run: vendor/bin/phpunit -c tests/phpunit.xml --testsuite unit --no-coverage | |
| integration: | |
| name: Integration tests (${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| services: | |
| db: | |
| image: mariadb:11.8 | |
| env: | |
| MARIADB_ROOT_PASSWORD: syspass | |
| MARIADB_DATABASE: syspass | |
| MARIADB_ROOT_HOST: '%' | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="healthcheck.sh --connect --innodb_initialized" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: pdo_mysql, gd, ldap, gettext, zip, intl, mbstring | |
| coverage: none | |
| ini-values: zend.assertions=1, memory_limit=-1 | |
| - name: Setup locales | |
| uses: ./.github/actions/setup-locales | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v4 | |
| with: | |
| composer-options: --prefer-dist | |
| - name: Load schema | |
| run: mysql -h 127.0.0.1 -P 3306 -u root -psyspass syspass < schemas/dbstructure.sql | |
| - name: Run integration tests | |
| env: | |
| DB_SERVER: 127.0.0.1 | |
| DB_NAME: syspass | |
| DB_USER: root | |
| DB_PASS: syspass | |
| DB_PORT: 3306 | |
| run: vendor/bin/phpunit -c tests/phpunit.xml --testsuite integration --no-coverage | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.5' | |
| extensions: pdo_mysql, gd, ldap, gettext, zip, intl, mbstring | |
| coverage: none | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v4 | |
| with: | |
| composer-options: --prefer-dist | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Create .env for PHPStan bootstrap | |
| run: echo "DEBUG=false" > .env | |
| - name: PHPStan | |
| run: vendor/bin/phpstan analyse --level 6 --error-format=github src | |
| - name: PHPCS | |
| run: composer phpcs | |
| - name: Verify vendor JS bundle is current | |
| run: npm run build:js && git diff --exit-code public/vendor/js/ | |
| e2e: | |
| name: E2E tests (Playwright) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'npm' | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Start the app stack | |
| run: docker compose up --build -d | |
| - name: Wait for the app to respond | |
| run: | | |
| for i in $(seq 1 30); do | |
| if curl -sf -o /dev/null "http://localhost:8090/index.php?r=install/index"; then | |
| echo "App is up after $((i * 3))s." | |
| exit 0 | |
| fi | |
| sleep 3 | |
| done | |
| echo "App did not become ready within 90s." >&2 | |
| docker compose logs | |
| exit 1 | |
| - name: Run Playwright e2e suite | |
| run: npm run test:e2e | |
| - name: Dump app logs on failure | |
| if: failure() | |
| run: docker compose logs | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report | |
| path: | | |
| playwright-report/ | |
| test-results/ | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| build-image: | |
| name: Build image | |
| needs: [unit, integration] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: docker/login-action@v4.6.0 | |
| if: github.event_name == 'push' | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/metadata-action@v6 | |
| id: meta | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=sha,prefix= | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| push: ${{ github.event_name == 'push' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| release: | |
| name: Release | |
| needs: build-image | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Extract changelog section for this version | |
| run: | | |
| version="${GITHUB_REF_NAME#v}" | |
| awk -v start="## [$version]" ' | |
| substr($0, 1, length(start)) == start { flag = 1; next } | |
| flag && substr($0, 1, 4) == "## [" { exit } | |
| flag { print } | |
| ' CHANGELOG.md > release-notes.md | |
| if [ ! -s release-notes.md ]; then | |
| echo "See CHANGELOG.md for details." > release-notes.md | |
| fi | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes-file release-notes.md \ | |
| --verify-tag |