-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple testing issues with the current GH Actions workflow and Composer scripts #274
Conversation
Previously commands were not executed within the docker container but outside of it on the virtual environment of github. Now all the tests will be done on the actual container
1ea1d41
to
3657b0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work again. I love seeing this taking shape!
See some feedback in the comments below.
@@ -44,7 +43,7 @@ jobs: | |||
- name: Build frontend assets | |||
run: cd ci/docker && docker-compose exec -T stepup-ra bash -c 'source "/usr/local/nvm/nvm.sh" && yarn encore production' | |||
- name: Run test scripts | |||
run: cd ci/docker && docker-compose exec -T stepup-ra bash -c ' composer test ' | |||
run: cd ci/docker && docker-compose exec -T stepup-ra bash -c ' composer test && source "/usr/local/nvm/nvm.sh" && yarn audit ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this commit can be dropped. As the source issue was later resolved.
ci/qa/security-tests
Outdated
|
||
"wget -q https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -O local-php-security-checker && chmod +x ./local-php-security-checker && ./local-php-security-checker", | ||
source "/usr/local/nvm/nvm.sh" | ||
yarn audit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give'er a linefeed will ya?
defaults: | ||
run: | ||
shell: bash -l {0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed, that was part of my R&D work.
ci/docker/docker-compose.yml
Outdated
stepup-ra: | ||
stdin_open: true | ||
tty: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try removing this option. I do not believe it being critical.
3657b0f
to
0a28c74
Compare
ci/qa/security-tests
Outdated
printf 'Curl failed downloading php-security-checker with error code "%d"\n' "$?" >&2 | ||
exit 1 | ||
fi | ||
source "/usr/local/nvm/nvm.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One final leftover that can now be removed as per bash -l
by adding the -l flag to the docker exec command there is no longer a need to source for yarn each time it is called
0a28c74
to
896f8b7
Compare
Inspecting the GHA output. I see Sebastian CPD throwing a fatal error. |
7f67a0d
to
1ebc344
Compare
PHPCPD was no longer functioning due to Xdebug 3 not supporting the version of PHPCPD we are using. PHPCPD could not be updated due to the projects PHP version not allowing it. Therefore there is chosen to replace PHPCPD with JSCPD.
1ebc344
to
7987f03
Compare
With the newest commit PHPCPD has been replaced with JSCPD, See latest commit for an explanation. |
The correct folders are now ignored, a limit of 30 duplicates is set for triggering a duplication warning. Breaching a project wide duplication treshold of 1% will start causing the copy paste detector to exit with a 1 status code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, I'm happy we found a good PHP CPD replacement. I'm not often happy about adding a JS dependency, but this is a great example.
Fixed 5 issues and added 1 feature
Workflow now installs dependencies and tests them on the container instead on the vm.
Yarn audit was not working properly due to a bash quirk.
Xdebug is now installed and enabled so the code coverage tests work as intended.
Other security audit now actually works instead of exiting with 0 even when it didn't run.
Moved local-php-security-checker to its own bash file instead of having a script in composer.json.
Replaced PHPCPD with JSCPD, due to Xdebug^3.0 PHPCPD would no longer work and therefore it is not replaced.