fix: address remaining PR review comments

- Use PR-scoped concurrency key to prevent cancellation across forks
- Reduce permissions: only release job needs contents:write
- Add bounded retry loop for MariaDB startup (30 attempts max)
- Derive Docker repo from DOCKER_USERNAME secret instead of hardcoding
- Delete codeql-analysis.yml (no longer needed)
- Update README: 'open-source' hyphenation, Docker image naming
This commit is contained in:
Ollama
2026-03-17 07:43:35 +00:00
parent d12b79a177
commit 8a31a65b7e
4 changed files with 23 additions and 82 deletions

View File

@@ -15,8 +15,8 @@ This document describes the CI/CD workflows for OSPOS.
- Run PHPUnit tests with MariaDB started via Docker
### Docker Images
- Build `ospos:latest` Docker image for multiple architectures (linux/amd64, linux/arm64)
- Push to Docker Hub on master branch
- Build and push `opensourcepos` Docker image for multiple architectures (linux/amd64, linux/arm64)
- Image tagged with version and `latest`, pushed to Docker Hub on master branch
### Releases
- Create distribution archives (tar.gz, zip)
@@ -50,7 +50,6 @@ This repository also has these workflows:
- `.github/workflows/main.yml` - PHP linting with PHP-CS-Fixer
- `.github/workflows/phpunit.yml` - PHPUnit tests
- `.github/workflows/php-linter.yml` - PHP linting
- `.github/workflows/codeql-analysis.yml` - Security analysis
## Testing

View File

@@ -11,12 +11,11 @@ on:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
packages: write
contents: read
jobs:
build:
@@ -162,10 +161,20 @@ jobs:
-p 3306:3306 \
mariadb:10.5
until docker exec mysql mysqladmin ping -h 127.0.0.1 -u root -proot --silent; do
echo "Waiting for MariaDB..."
for i in {1..30}; do
if docker exec mysql mysqladmin ping -h 127.0.0.1 -u root -proot --silent; then
echo "MariaDB is ready"
break
fi
echo "Waiting for MariaDB... ($i/30)"
sleep 2
done
docker exec mysql mysqladmin ping -h 127.0.0.1 -u root -proot --silent || {
echo "MariaDB failed to become ready"
docker logs mysql || true
exit 1
}
- name: Initialize database
run: docker exec -i mysql mysql -u root -proot ospos < app/Database/database.sql
@@ -204,20 +213,24 @@ jobs:
- name: Build and push Docker images
uses: docker/build-push-action@v5
env:
IMAGE_REPO: ${{ secrets.DOCKER_USERNAME }}/opensourcepos
with:
context: .
target: ospos
platforms: linux/amd64,linux/arm64
push: true
tags: |
jekkos/opensourcepos:${{ needs.build.outputs.version-tag }}
jekkos/opensourcepos:latest
${{ env.IMAGE_REPO }}:${{ needs.build.outputs.version-tag }}
${{ env.IMAGE_REPO }}:latest
release:
name: Create Release
needs: [build, test]
runs-on: ubuntu-22.04
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- name: Checkout

View File

@@ -1,71 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '21 12 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@@ -140,4 +140,4 @@ Any person or company found breaching the license agreement might find a bunch o
| <div align="center">DigitalOcean</div> | <div align="center">JetBrains</div> | <div align="center">GitHub</div> |
| --- | --- | --- |
| <div align="center"><a href="https://www.digitalocean.com?utm_medium=opensource&utm_source=opensourcepos" target="_blank"><img src="https://github.com/user-attachments/assets/fbbf7433-ed35-407d-8946-fd03d236d350" alt="DigitalOcean Logo" height="50"></a></div> | <div align="center"><a href="https://www.jetbrains.com/idea/" target="_blank"><img src="https://github.com/opensourcepos/opensourcepos/assets/12870258/187f9bbe-4484-475c-9b58-5e5d5f931f09" alt="IntelliJ IDEA Logo" height="50"></a></div> | <div align="center"><a href="https://github.com/features/actions" target="_blank"><img src="https://github.githubassets.com/images/modules/site/icons/eyebrow-panel/actions-icon.svg" alt="GitHub Actions Logo" height="50"></a></div> |
| Many thanks to [DigitalOcean](https://www.digitalocean.com) for providing the project with hosting credits. | Many thanks to [JetBrains](https://www.jetbrains.com/) for providing a free license of [IntelliJ IDEA](https://www.jetbrains.com/idea/) to kindly support the development of OSPOS. | Many thanks to [GitHub](https://github.com) for providing free continuous integration via GitHub Actions for open source projects. |
| Many thanks to [DigitalOcean](https://www.digitalocean.com) for providing the project with hosting credits. | Many thanks to [JetBrains](https://www.jetbrains.com/) for providing a free license of [IntelliJ IDEA](https://www.jetbrains.com/idea/) to kindly support the development of OSPOS. | Many thanks to [GitHub](https://github.com) for providing free continuous integration via GitHub Actions for open-source projects. |