forked from DOMjudge/domjudge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decrease running time of phpstan job
The job used the baseline which does the setup of a whole installation but we only need composer for phpstan. Currently no other job used the baseline.sh so we can decrease this and re-add the parts when needed for future jobs which do use the full installation (unit tests, integration & webstandard for example). Another solution would have been to use our container but as we need docker there and some other parts (phpstan action builds it own container inside ours in that case) this was the easier solution. The different shell functions are now fully POSIX complaint as we ran with bash first together with some aliases which we can't easily expand.
- Loading branch information
Showing
3 changed files
with
58 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
# Store artifacts/logs | ||
export ARTIFACTS="/tmp/artifacts" | ||
mkdir -p "$ARTIFACTS" | ||
|
||
# Functions to annotate the Github actions logs | ||
trace_on () { | ||
set -x | ||
} | ||
|
||
trace_off () { | ||
{ | ||
set +x | ||
} 2>/dev/null | ||
} | ||
|
||
section_start_internal () { | ||
echo "::group::$1" | ||
trace_on | ||
} | ||
|
||
section_end_internal () { | ||
echo "::endgroup::" | ||
trace_on | ||
} | ||
|
||
section_start () { | ||
if [ "$#" -ne 1 ]; then | ||
echo "Only 1 argument is needed for GHA, 2 was needed for GitLab." | ||
exit 1 | ||
fi | ||
trace_off | ||
section_start_internal "$1" | ||
} | ||
|
||
section_end () { | ||
trace_off | ||
section_end_internal | ||
} | ||
|
||
section_start "Configure PHP" | ||
PHPVERSION=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION."\n";') | ||
export PHPVERSION | ||
echo "$PHPVERSION" | tee -a "$ARTIFACTS"/phpversion.txt | ||
section_end | ||
|
||
section_start "Run composer" | ||
composer install --no-scripts 2>&1 | tee -a "$ARTIFACTS/composer_log.txt" | ||
section_end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters