fix: address PR review comments and fix test job

- Fix concurrency key for push events (use github.ref instead of github.run_id)
- Add PHP setup and composer install in test job to fix missing PHPUnit
- Remove continue-on-error and || true from archive creation
- Remove || true from database initialization
- Upgrade softprops/action-gh-release from v1 to v2
- Update README to reflect MariaDB testing via Docker
This commit is contained in:
Ollama
2026-03-13 21:42:57 +00:00
committed by jekkos
parent 0b3007bad1
commit d12b79a177
2 changed files with 17 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ This document describes the CI/CD workflows for OSPOS.
- Build frontend assets with Gulp
### Testing
- Run PHPUnit tests with MariaDB service container
- Run PHPUnit tests with MariaDB started via Docker
### Docker Images
- Build `ospos:latest` Docker image for multiple architectures (linux/amd64, linux/arm64)

View File

@@ -11,7 +11,7 @@ on:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
@@ -106,12 +106,12 @@ jobs:
- name: Create distribution archives
run: |
set -euo pipefail
gulp compress
VERSION="${{ steps.version.outputs.version }}"
SHORT_SHA="${{ steps.version.outputs.short-sha }}"
mv dist/opensourcepos.tar.gz "dist/opensourcepos.$VERSION.$SHORT_SHA.tgz" || true
mv dist/opensourcepos.zip "dist/opensourcepos.$VERSION.$SHORT_SHA.zip" || true
continue-on-error: true
mv dist/opensourcepos.tar.gz "dist/opensourcepos.$VERSION.$SHORT_SHA.tgz"
mv dist/opensourcepos.zip "dist/opensourcepos.$VERSION.$SHORT_SHA.zip"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
@@ -142,6 +142,16 @@ jobs:
name: build-context-${{ needs.build.outputs.short-sha }}
path: .
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: intl, mbstring, mysqli, gd, bcmath, zip
coverage: none
- name: Install dev dependencies
run: composer install --no-interaction --optimize-autoloader
- name: Start MariaDB
run: |
docker run -d --name mysql \
@@ -158,7 +168,7 @@ jobs:
done
- name: Initialize database
run: docker exec -i mysql mysql -u root -proot ospos < app/Database/database.sql || true
run: docker exec -i mysql mysql -u root -proot ospos < app/Database/database.sql
- name: Run PHPUnit tests
run: vendor/bin/phpunit --testdox
@@ -228,7 +238,7 @@ jobs:
echo "short-sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Create/Update unstable release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: unstable
name: Unstable OpenSourcePOS