Skip to content

Improve Automatic Tests for CI on alpine-php-webserver Using GitHub Actions #35

@erseco

Description

@erseco

The current setup for Continuous Integration (CI) in the alpine-php-webserver repository could be enhanced to provide more robust and comprehensive automated testing for the Docker image. Improving the testing process will help ensure higher reliability and prevent regressions when introducing new features or updates.


Proposed Improvements

  1. Add Multi-Platform Build and Tests:

    • Ensure the image is tested on multiple architectures (amd64, arm64, etc.) using Docker Buildx.
    • Validate compatibility and functionality across platforms.
  2. Lint Dockerfile and Shell Scripts:

  3. Run Containerized Tests:

    • Test the Docker image by running it and executing basic PHP scripts.
    • Verify Nginx and PHP-FPM functionality by simulating web requests using tools like curl or PHPUnit tests for web servers.
  4. Check for Vulnerabilities:

  5. Cache Optimization:

    • Implement caching strategies for Docker layers and Composer dependencies during the CI process to speed up builds.
  6. Automate Publishing on Successful Tests:

    • Automatically publish the Docker image to the registry only if all tests pass and on specific triggers (e.g., tags or branches like main).

Acceptance Criteria

  • CI workflow runs tests for multi-platform builds and passes without errors.
  • Dockerfile and scripts are linted during the CI workflow.
  • Tests verify PHP and Nginx configurations work as expected.
  • Vulnerability scan integrates into the CI pipeline with clear reporting.
  • Workflow outputs are clear and informative for debugging.

Additional Context

Implementing these improvements will align the repository with modern CI/CD practices and increase confidence in the image's stability and security. It also provides contributors with immediate feedback on their changes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions