diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 958745bfc..a60d66a7e 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 856e32516..44175eb3f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -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