@@ -13,7 +13,96 @@ on: # yamllint disable-line rule:truthy
1313 - " beta"
1414
1515jobs :
16- Semantic-Release :
16+ config-check :
17+ name : " Config Check"
18+
19+ runs-on : " ubuntu-latest"
20+
21+ strategy :
22+ matrix :
23+ php-versions : [ "8.0" ]
24+ dependencies : [ "locked" ]
25+
26+ env :
27+ key : " license-update-linux-v2" # change key (version) to clear cache
28+ extensions : " mbstring"
29+ ini-values : " date.timezone=Europe/Berlin, assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=0, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M, serialize_precision=14"
30+ tools : " composer, cs2pr"
31+
32+ steps :
33+ - name : " Git checkout"
34+ uses : " actions/checkout@v2"
35+ with :
36+ fetch-depth : 2
37+ env :
38+ GIT_COMMITTER_NAME : " GitHub Actions Shell"
39+ GIT_AUTHOR_NAME : " GitHub Actions Shell"
40+ EMAIL : " github-actions[bot]@users.noreply.github.com"
41+
42+ - name : " Setup cache environment"
43+ id : " cache-env"
44+ uses : " shivammathur/cache-extensions@v1"
45+ with :
46+ php-version : " ${{ matrix.php-versions }}"
47+ extensions : " ${{ env.extensions }}"
48+ key : " ${{ env.key }}"
49+
50+ - name : " Cache extensions"
51+ uses : " actions/cache@v2"
52+ with :
53+ path : " ${{ steps.cache-env.outputs.dir }}"
54+ key : " ${{ steps.cache-env.outputs.key }}"
55+ restore-keys : " ${{ steps.cache-env.outputs.key }}"
56+
57+ - name : " Setup PHP"
58+ uses : " shivammathur/setup-php@v2"
59+ with :
60+ php-version : " ${{ matrix.php-versions }}"
61+ extensions : " ${{ env.extensions }}"
62+ ini-values : " ${{ env.ini-values }}"
63+ tools : " ${{ env.tools }}"
64+ coverage : " pcov"
65+
66+ - name : " Setup Problem Matchers for PHP"
67+ run : " echo '::add-matcher::${{ runner.tool_cache }}/php.json'"
68+
69+ - name : " Check PHP Version"
70+ run : " php -v"
71+
72+ - name : " List all php extensions with versions"
73+ run : " php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . \" \" . phpversion($extension) . PHP_EOL;'"
74+
75+ - name : " Configure Container"
76+ env :
77+ GIT_USER_EMAIL : " ${{ secrets.GIT_USER_EMAIL }}"
78+ GIT_USER_USERNAME : " ${{ secrets.GIT_USER_USERNAME }}"
79+ run : |
80+ EMAIL=${GIT_USER_EMAIL:-"github-actions[bot]@users.noreply.github.com"}
81+ NAME=${GIT_USER_USERNAME:-"github-actions-shell"}
82+
83+ git config --global user.email "${EMAIL}"
84+ git config --global user.name "${NAME}"
85+
86+ - name : " Check Composer Version"
87+ run : " composer -V"
88+
89+ - name : " Validate composer.json and composer.json"
90+ run : " composer validate --strict"
91+
92+ - name : " Install dependencies with Composer"
93+ uses : " ramsey/composer-install@v1"
94+ with :
95+ dependency-versions : " ${{ matrix.dependencies }}"
96+
97+ - name : " validate .php_cs file"
98+ run : |
99+ mkdir -p ./.build/php-cs-fixer
100+ ./vendor/bin/php-cs-fixer fix --config='./.php_cs' --ansi --dry-run
101+
102+ - name : " validate base_rules.neon file"
103+ run : " ./vendor/bin/phpstan analyse -c ./base_rules.neon ./"
104+
105+ semantic-release :
17106 name : " Semantic Release"
18107
19108 if : " github.repository != 'narrowspark/php-library-template'"
0 commit comments