Upgrade the current GitHub action with the latest version of ubuntu image, PHP, and vip-go-ci.
Code quality improvements; Refactor Dockerfile(optimization) and main.sh(code quality improvement).
Bump default PHP version to 8.1; vault version to 1.12.3 and vip-go-ci to
Add support for multiple PHP versions; namely 7.4, 8.0, 8.1, and 8.2.
Add feature of GitHub commit status by passing ENABLE_STATUS_CHECKS to true in env.
Deprecated the usage of the Hashicorp vault.
Fix the PHPCS error ERROR: No sniffs were registered due to PHPCSUtils standard by passing it to --phpcs-standards-to-ignore.
Relevant technical choices
Dockerfile
Use ARG and ENV to define specific variables as they can be altered on image build time without making edits to Dockerfile; use generic variable names.
Updated image to run as a non-privileged user instead of the root user which also reduces the gosu as a dependency.
Remove unused package installs from the image, namely gosu, python, python-pip, sudo, tree, vim, zip, shyaml.
Add cleanup commands to remove the package list, temp files, and unused packages.
Merge the RUN commands which were aimed at the single responsibility; i.e. installing packages.
main.sh
Add a check to gracefully exit if the action is not triggered at the pull_request event, because vip-go-ci only works on pull requests as per README.
Add utility logger function to show INFO, STATUS, and SUCESS messages to make GHA logs readable.
Add dock blocks on PHPCS arguments for proper documentation.
Construct the PHPCS command in a progressive way i.e. build the command as you declare the PHPCS argument. Why? It will help to associate every command flag with the argument so easy to debug and even remove.
Summary
vip-go-ci
.8.1
; vault version to1.12.3
and vip-go-ci to7.4, 8.0, 8.1, and 8.2
.ENABLE_STATUS_CHECKS
to true in env.ERROR: No sniffs were registered
due to PHPCSUtils standard by passing it to--phpcs-standards-to-ignore
.Relevant technical choices
Dockerfile
ARG
andENV
to define specific variables as they can be altered on image build time without making edits to Dockerfile; use generic variable names.gosu
as a dependency.gosu, python, python-pip, sudo, tree, vim, zip, shyaml
.RUN
commands which were aimed at the single responsibility; i.e. installing packages.main.sh
pull_request
event, becausevip-go-ci
only works on pull requests as per README.INFO
,STATUS
, andSUCESS
messages to make GHA logs readable.CMD=( "--phpcs=true" )
Set --phpcs-standard
CMD+=( "--phpcs-standard=true" )
Set --phpcs-path
CMD+=( "--phpcs-path=/path/to/phpcs" )
Finally run
"${CMD[@]}"